Re: how to get the thighest bit position in big integers?

2008-10-28 Thread Nick Mellor
On Oct 6, 3:40 am, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > I'm using python to develop some proof-of-concept code for a > > cryptographic application. My code makes extended use of python's > > native bignum capabilities. > > > In many cryptographic applicati

Re: How to get high precision timer in python?

2008-10-28 Thread Tim Roberts
"" <[EMAIL PROTECTED]> wrote: >2008/10/29 James Mills <[EMAIL PROTECTED]>: >> On Wed, Oct 29, 2008 at 12:14 PM, <[EMAIL PROTECTED]> wrote: >>> I use python2.5 in WindowsXP. If using time.time() as timer, it seems >> >> On the win32 platform should you not >> be using time.clock vs. time.t

Re: Finding the instance reference of an object

2008-10-28 Thread Douglas Alan
Joe Strout <[EMAIL PROTECTED]> writes: > There are only the two cases, which Greg quite succinctly and > accurately described above. One is by value, the other is by > reference. Python quite clearly uses by value. You make a grave error in asserting that there are only two cases. Algol, for in

Re: Unpacking byte strings from a file of unknown size

2008-10-28 Thread Mark
> this code python interprets as: > > data = myfile.read(10) > for chunk in data: > . > Aha - now that you put it that way it makes sense. And thanks to all who replied - I'll try out the other suggestions too. Mark -- http://mail.python.org/mailman/listinfo/python-list

Graphical object browser

2008-10-28 Thread Jason
Hi, I've spent all day looking for a graphical object browser for Python 2.5 under Debian GNU/Linux, ie. something I can just drop into my code with an import and a "browse(my_object)" statement. So far I've only found intractable GUI toolkits or obsolete, non-functional scripts. I was wondering

Re: print_function and unicode_literals cannot be used at the same time?

2008-10-28 Thread Benjamin
On Oct 27, 1:00 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Sun, 26 Oct 2008 12:13:08 -0200, Christian Heimes <[EMAIL PROTECTED]> > > escribió: > > >> ?? wrote: > >>> Any ideas? > >>>  Code 1: > >>>  from __future__ import print_function, unicode_literals > >>>

[Novice]Installing eric4 with python 2.6

2008-10-28 Thread Saurabh Agrawal
Hi, I am fairly new to python. Coming from a world of IDEs, I wanted a fancier one than IDLE. Hence, I downloaded eric4. When I tried to compile it, it asked for PyQt4, which I again downloaded (exe for Windows XP) and installed it. It seems to be properly installed as I can invoke "import PyQt4"

Re: How to get high precision timer in python?

2008-10-28 Thread 甜瓜
^_^ Oh! I did not read the document for time.clock before, and supposed it was same with time.time(). Thank you very much. ShenLei -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get high precision timer in python?

2008-10-28 Thread James Mills
2008/10/29 甜瓜 <[EMAIL PROTECTED]>: > 2008/10/29 James Mills <[EMAIL PROTECTED]>: >> On Wed, Oct 29, 2008 at 12:14 PM, 甜瓜 <[EMAIL PROTECTED]> wrote: >>> I use python2.5 in WindowsXP. If using time.time() as timer, it seems >> >> On the win32 platform should you not >> be using time.clock vs. time.ti

Re: How to get high precision timer in python?

2008-10-28 Thread 甜瓜
2008/10/29 James Mills <[EMAIL PROTECTED]>: > On Wed, Oct 29, 2008 at 12:14 PM, 甜瓜 <[EMAIL PROTECTED]> wrote: >> I use python2.5 in WindowsXP. If using time.time() as timer, it seems > > On the win32 platform should you not > be using time.clock vs. time.time ? > Well, whatelse can I use? ShenLei

Re: How to get high precision timer in python?

2008-10-28 Thread James Mills
On Wed, Oct 29, 2008 at 12:14 PM, 甜瓜 <[EMAIL PROTECTED]> wrote: > I use python2.5 in WindowsXP. If using time.time() as timer, it seems On the win32 platform should you not be using time.clock vs. time.time ? --JamesMills -- -- -- "Problems are solved by method" -- http://mail.python.org/mailma

How to get high precision timer in python?

2008-10-28 Thread 甜瓜
Howdy, I use python2.5 in WindowsXP. If using time.time() as timer, it seems the maximum precision is about 10-12ms. Maybe this is caused by the time slice defined in process scheduler. However, in my project, I have to get timer percision up to 1ms. What should I do? Do I have to call Win32 API?

Re: gl Multiple versions of python

2008-10-28 Thread James Mills
On Wed, Oct 29, 2008 at 11:50 AM, Glenn Linderman <[EMAIL PROTECTED]> wrote: >>> When using multiple versions of Python co-installed on the same system, >>> what happens with local .pyc files? If the .py is loaded with a >>> different version of Python, is the .pyc rebuilt (even if the .py hasn't

Re: Contracts for Python

2008-10-28 Thread alex23
On Oct 29, 3:47 am, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > I am wondering if there is any work on contracts for Python. I could > only find PEP316, however, I am wondering if there is any official > support for it already (tools I mean), and if it is or if it will be > officially supported i

Re: import foo vs. python -m foo

2008-10-28 Thread Asun Friere
On Oct 29, 7:35 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > It probably contains buggy code inside "if __name__ == '__main__': ...". Or the code contains a run-time error? -- http://mail.python.org/mailman/listinfo/python-list

Earn $$$ Without Investment.

2008-10-28 Thread chinu
hai, i am srinu from india. i am sending a blog url for yours use. Right side Of The Blog Awsurvey Banner will appear. click on the banner and get a free signup with 6$ bonus and you will get more surveys. once you have completed one survey you will get minimem 4$ and more left side of the blog

Re: How to get an object's name as a string?

2008-10-28 Thread alex23
On Oct 29, 12:41 am, Shannon Mayne <[EMAIL PROTECTED]> wrote: > I would like to create objects with algorithmically determined names > based on other object names and use object names for general algorithm > input. The simplest and best option here is to store the objects in a dictionary with thei

Re: Using threads to quit the main python process

2008-10-28 Thread James Mills
On Wed, Oct 29, 2008 at 10:42 AM, sharpblade <[EMAIL PROTECTED]> wrote: > Is there a way I can use threads to quit the main python process? > In brief, I have a python script that starts when my computer starts. It > chooses a random wallpaper background out of a specified path, and sets it > as th

Re: calling python from lisp

2008-10-28 Thread Kaz Kylheku
["Followup-To:" header set to comp.lang.lisp.] On 2008-10-29, Martin Rubey <[EMAIL PROTECTED]> wrote: > Dear all, > > I'm trying to call from common lisp functions written for Sage > (www.sagemath.org), which in turn is written in python. Maybe those functions will work under CLPython? CLPython

Re: Sorting a list

2008-10-28 Thread duncan smith
RC wrote: > unsortedList = list(["XYZ","ABC"]) > > sortedList = unsortedList.sort() > print sortedList > > > Why this return None? Because the sort method sorts the list in place (and returns None). > How do I get return as ["ABC", "XYZ"]? >>> unsortedList = ["XYZ","ABC"] >>> unsortedList.sor

Re: How to get an object's name as a string?

2008-10-28 Thread Joe Strout
On Oct 28, 2008, at 6:58 PM, Steve Holden wrote: Objects in Python *don't* have names. Period. In Python we don't normally talk about variables anyway, except when speaking loosely, we talk about binding names. But please don't let this start another round of "Python programmers don't know ho

Re: gl Multiple versions of python

2008-10-28 Thread Steve Holden
Glenn Linderman wrote: > When using multiple versions of Python co-installed on the same system, > what happens with local .pyc files? If the .py is loaded with a > different version of Python, is the .pyc rebuilt (even if the .py hasn't > changed)? > > Or must one manually delete the .pyc files?

Re: How to get an object's name as a string?

2008-10-28 Thread Joe Strout
On Oct 28, 2008, at 4:45 PM, Steven D'Aprano wrote: What do you mean by the "name" of an object? Objects don't generally have names, unless you explicitly define a .name property and assign them names. (Variables have names, of course, but a variable isn't an object -- it's just a reference

Re: How to get an object's name as a string?

2008-10-28 Thread Steve Holden
Steven D'Aprano wrote: > On Tue, 28 Oct 2008 09:15:50 -0600, Joe Strout wrote: > >> On Oct 28, 2008, at 8:41 AM, Shannon Mayne wrote: >> >>> I would like to create objects with algorithmically determined names >>> based on other object names and use object names for general algorithm >>> input. >>

Using threads to quit the main python process

2008-10-28 Thread sharpblade
Is there a way I can use threads to quit the main python process? In brief, I have a python script that starts when my computer starts. It chooses a random wallpaper background out of a specified path, and sets it as the desktop wallpaper. It also hooks some windows hot keys so I can cycle through

calling python from lisp

2008-10-28 Thread Martin Rubey
Dear all, I'm trying to call from common lisp functions written for Sage (www.sagemath.org), which in turn is written in python. To do so, I tried http://common-lisp.net/project/python-on-lisp/. It was quite easy to get it to run and do some simple things with python. However, I was unable to g

Re: Tkinter: How to get Label wraplength functionality in Text Box

2008-10-28 Thread Guilherme Polo
On 10/28/08, Mudcat <[EMAIL PROTECTED]> wrote: > I've tried quite a few things to get this correct but have hit a > couple of sticking points that I can't figure out. I need to ge the > Text box to function like the 'wraplength' option in a Label. > > I've been able to adjust the height of the t

urlsplit() and windows paths

2008-10-28 Thread Patrick Mézard
Hello, Why does urlparse.urlsplit() succeed here ? """ Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import urlparse >>> urlparse.urlsplit('c:\\foo\\bar') ('c', '',

Re: Deviation from object-relational mapping (pySQLFace)

2008-10-28 Thread sulyokpeti
On okt. 22, 06:27, huy <[EMAIL PROTECTED]> wrote: > On Oct 12, 11:19 am, [EMAIL PROTECTED] wrote: > > > I have made a simple python module to handle SQL > > databases:https://fedorahosted.org/pySQLFace/wiki > > Its goal to separate relational database stuff (SQL) from algorythmic > > code (python)

Re: How to get an object's name as a string?

2008-10-28 Thread Steven D'Aprano
On Tue, 28 Oct 2008 09:15:50 -0600, Joe Strout wrote: > On Oct 28, 2008, at 8:41 AM, Shannon Mayne wrote: > >> I would like to create objects with algorithmically determined names >> based on other object names and use object names for general algorithm >> input. > > What do you mean by the "nam

Re: Extracting name strings from assigned objects

2008-10-28 Thread Steven D'Aprano
On Tue, 28 Oct 2008 09:23:46 -0700, Shannon Mayne wrote: > I would like to ask how one might obtain the assigned name of an > assigned object as a string. I would like to use object names as an > algorithmic input. > > > To demonstrate... So if i have: > >>>foo = {} > > what can I do to the ob

Re: Finding the instance reference of an object

2008-10-28 Thread Steven D'Aprano
On Tue, 28 Oct 2008 09:59:57 -0600, Joe Strout wrote: > There are only the two cases, which Greg quite succinctly and accurately > described above. One is by value, the other is by reference. Python > quite clearly uses by value. That is absolute nonsense, based on the idiotic assumption that

Re: explanation of values, references, assignment, and method calls

2008-10-28 Thread Aaron Brady
On Oct 28, 11:30 am, Bruno Desthuilliers wrote: > Joe Strout a écrit : > > > I've tried to write up this topic in a clear, step-by-step manner, with > > the help of diagrams and short examples from several different OOP > > languages.  I hope it will help clear up the confusion that seems to be >

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Martin v. Löwis
> Because then we're back into the GIL not permitting threads efficient > core use on CPU bound scripts running on other threads (when they > otherwise could). Why do you think so? For C code that is carefully written, the GIL allows *very well* to write CPU bound scripts running on other threads.

Re: Do I need a lock here?

2008-10-28 Thread Aaron Brady
On Oct 28, 3:29 pm, jasiu85 <[EMAIL PROTECTED]> wrote: > On Oct 27, 10:12 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > jasiu85 schrieb: > > > > Hey, > > > > Please take a look at the code of the two threads below: > > > > COMMON_DICT = {} > > > > def thread_1(): > > >     global COMM

Re: Finding the instance reference of an object

2008-10-28 Thread Aaron Brady
On Oct 27, 2:11 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 27, 2008, at 12:19 PM, [EMAIL PROTECTED] wrote: > > > I think this "uncontrived" example addresses the C/Python difference > > fairly directly (both were tested): > > That's correct, but of course, C is a decades-old language barely

Re: Database specialized in storing directed graphs?

2008-10-28 Thread Aaron Brady
On Oct 27, 7:32 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > I was wondering if anyone had any advice on this. > > This is not to study graph theory; I'm using the graph to represent a > problem domain.  The graphs could be arbitrarily large, and could > easily have millions of nodes, and most nodes

Tkinter: How to get Label wraplength functionality in Text Box

2008-10-28 Thread Mudcat
I've tried quite a few things to get this correct but have hit a couple of sticking points that I can't figure out. I need to ge the Text box to function like the 'wraplength' option in a Label. I've been able to adjust the height of the text by calculating the number of lines needed to display th

Re: import foo vs. python -m foo

2008-10-28 Thread Hrvoje Niksic
Simon Bierbaum <[EMAIL PROTECTED]> writes: > Hi all, > > what is the difference between saying "import foo" in an interactive > prompt and starting one using "python -m foo"? The -m switch is not > covered in the man page, is it even officially supported? My copy of the man page states: -m modul

Re: Do I need a lock here?

2008-10-28 Thread jasiu85
On Oct 27, 10:12 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > jasiu85 schrieb: > > > > > Hey, > > > Please take a look at the code of the two threads below: > > > COMMON_DICT = {} > > > def thread_1(): > >     global COMMON_DICT > >     local_dict = prepare_dict() > >     COMMON_DICT = local

Re: HTML File Parsing

2008-10-28 Thread Stefan Behnel
Felipe De Bene wrote: > I'm having problems parsing an HTML file with the following syntax : > > > User ID > Name BGCOLOR='#c0c0c0'>Date > and so on > > whenever I feed the parser with such file I get the error : > > HTMLParser.HTMLParseError: bad end tag: "", at > line 515, column

Re: parse a table in HTML page.

2008-10-28 Thread Stefan Behnel
antonio_wn8 wrote: > I have a need to read and parse a table in HTML page. > > I’m using the following script: > http://trac.davidgrant.ca/browser/src/python/misc/siteuptime/TableParser.py > > It works fine aside from link in href. > > Example: > > String to parse: > elognormal text > > Outp

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Rhamphoryncus
On Oct 28, 9:30 am, "Andy O'Meara" <[EMAIL PROTECTED]> wrote: > On Oct 25, 9:46 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > > > These discussion pop up every year or so and I think that most of them > > are not really all that necessary, since the GIL isn't all that bad. > > Thing is, if the t

Re: big objects and avoiding deepcopy?

2008-10-28 Thread Daniel da Silva
http://groups.google.com/group/perl.perl6.language/msg/b0cfa757f0ce1cfd?pli=1 : ) On Mon, Oct 27, 2008 at 1:12 PM, <[EMAIL PROTECTED]> wrote: > Robert Kern: > > This is similar to implementing "Undo" functionality in applications.< > > In a quite-high-level language (like Python, but not necess

HTML File Parsing

2008-10-28 Thread Felipe De Bene
I'm having problems parsing an HTML file with the following syntax : User ID NameDate and so on whenever I feed the parser with such file I get the error : Traceback (most recent call last): File "C:\Documents and Settings\Administrator\My Documents\workspace \thread\src\parser.py

Re: Finding the instance reference of an object

2008-10-28 Thread Dale Roberts
On Oct 28, 11:59 am, Joe Strout <[EMAIL PROTECTED]> wrote: > ... > > There are only the two cases, which Greg quite succinctly and   > accurately described above.  One is by value, the other is by   > reference.  Python quite clearly uses by value.  Parameters are   > expressions that are evaluated

Re: question about the textwrap module

2008-10-28 Thread TP
Gabriel Genellina wrote: > You may pre-process your text (stripping redundant whitespace) before > using textwrap: Thanks Gabriel for your answers! I finally have subclassed textwrap.TextWrapper. Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z (55l4('])" "W

Re: ignoring NAs in a dataset with numpy

2008-10-28 Thread Robert Kern
mrafi wrote: Hey All, I am working with numpy I have a data set with a lot of nan values, and i want to calculate standard deviation is there a direct function to do it for example nansum(or something like this), to calculate standard deviation ignoring nan values?? You will want to ask numpy

Re: big objects and avoiding deepcopy?

2008-10-28 Thread Aaron Brady
On Oct 27, 1:10 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Robert Kern: > >> This is similar to implementing "Undo" functionality in applications.< > > > In a quite-high-level language (like Python, but not necessarily in > > Python itself) it may become eventually ad

import foo vs. python -m foo

2008-10-28 Thread Simon Bierbaum
Hi all, what is the difference between saying "import foo" in an interactive prompt and starting one using "python -m foo"? The -m switch is not covered in the man page, is it even officially supported? I'm asking because one of my modules fails on import in the second version but succeed

Re: Database specialized in storing directed graphs?

2008-10-28 Thread flyingfrog
Don't really know if this will be useful but i'd try pytables: http://www.pytables.org/moin it deals very well with every kind of hierarchical data sets, doesn't matter the size. It will let you load only significant data, and you'll be able to query your data. It's built on top of HDF5 libraries b

Re: Return lines in file that match string

2008-10-28 Thread Chris Rebert
On Tue, Oct 28, 2008 at 11:37 AM, Travis Kirstine <[EMAIL PROTECTED]> wrote: > I am new to python and could use some help with a fairly easy task. I > would like to return all lines in a file that have the string > '' to a list. > from __future__ import with_statement with open('path/to/file') a

Re: Contracts for Python

2008-10-28 Thread Chris Rebert
On Tue, Oct 28, 2008 at 10:47 AM, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > Hi all, > > I am wondering if there is any work on contracts for Python. I could > only find PEP316, however, I am wondering if there is any official > support for it already (tools I mean), and if it is or if it will be

Re: 404 not found on for Python 2.6 Itanium

2008-10-28 Thread Christian Heimes
[EMAIL PROTECTED] wrote: Anyone know where else I can download 2.6 for x64 windows? x64 is AMD64 aka X64_86 and not the Itanium version. Itanium is IA64. We don't build Python for IA64 anymore. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Unit Testing: a couple of questions

2008-10-28 Thread Marco Bizzarri
On Tue, Oct 28, 2008 at 3:56 PM, Emanuele D'Arrigo <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I'm just having a go with Unit Testing for the first time and my > feeling about it in short is: Neat! > > I'm a bit worried about the time it's taking me to develop the tests > but after only a day or

Return lines in file that match string

2008-10-28 Thread Travis Kirstine
I am new to python and could use some help with a fairly easy task. I would like to return all lines in a file that have the string '' to a list. Regards, -- Travis K. Toronto, Canada "She knows there's no success like failure And th

zipping a directory

2008-10-28 Thread Callie Bertsche
Hey Python-ers, I apologize if this is covered in the archives; I think I saw one instance of it but I couldn't get the solution to work out. I'm working on zipping an entire directory to one zip file. I can zip a flat group of files, but when my code encounters a hierarchy of folders, for some rea

Specifying an IP address for outbound connections?

2008-10-28 Thread erikcw
Python seems to default to the main system IP for outbound connections (such as urllib), but I want to bind to one of my other IPs for outbound connections. Any ideas? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

404 not found on for Python 2.6 Itanium

2008-10-28 Thread csgrimes1
Anyone know where else I can download 2.6 for x64 windows? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Contracts for Python

2008-10-28 Thread Paulo J. Matos
Hi all, I am wondering if there is any work on contracts for Python. I could only find PEP316, however, I am wondering if there is any official support for it already (tools I mean), and if it is or if it will be officially supported in any of the next releases of Python. Cheers, -- Paulo Jorge

Re: Web crawler on python

2008-10-28 Thread Alex
On Oct 26, 9:54 pm, sonich <[EMAIL PROTECTED]> wrote: > I need simple web crawler, > I found Ruya, but it's seems not currently maintained. > Does anybody know good web crawler on python or with python interface? You should try Orchid http://pypi.python.org/pypi/Orchid/1.1 or you can have a look

Re: dictionary

2008-10-28 Thread D'Arcy J.M. Cain
On Tue, 28 Oct 2008 10:41:20 -0400 Steve Holden <[EMAIL PROTECTED]> wrote: > Sorry, you are thinking of bistable multivibrators. I was talking about > the Wiliams tube store: > > http://ed-thelen.org/comp-hist/SEAC-Williams-tube-desc.html Very cool. Yes, I was thinking of something else. Howe

Re: Unit Testing: a couple of questions

2008-10-28 Thread Mel
Emanuele D'Arrigo wrote: > I'm a bit worried about the time it's taking me to develop the tests > but after only a day or so I'm already much faster than when I started > with it and the code is already much improved in terms of robustness. > A couple of "philosophical" questions have emerged in th

Re: Python suitable for Midi ?

2008-10-28 Thread Derek Martin
On Tue, Oct 28, 2008 at 06:54:57PM +0200, Chuckk Hubbard wrote: > The problem I've run into is that I can't set the audio to a higher > priority than the GUI (Tkinter). If I move the mouse over the app, no > matter what, I get audio dropouts. AFAICT this is the same for all > Python, regardless o

Re: Extracting name strings from assigned objects

2008-10-28 Thread Simon Brunning
2008/10/28 Shannon Mayne <[EMAIL PROTECTED]>: > I would like to ask how one might obtain the assigned name of an > assigned object as a string. That's in the FAQ: . -- Cheers, Simon B. [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the instance reference of an object

2008-10-28 Thread Dale Roberts
On Oct 28, 2:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 28 Oct 2008 01:16:04 -0200, Dale Roberts <[EMAIL PROTECTED]>   > escribió: > > > > > So, then, what to tell a C++ programmer about how Python passes   > > arguments? You say: tell them Python only passes by value. I disagr

Re: Python suitable for Midi ?

2008-10-28 Thread Chuckk Hubbard
I'm writing a sequencer in Python, although it's microtonal and not MIDI. I'm using the Python bindings for the Csound API, all the timing, MIDI, OSC, etc. stuff, essentially all but the GUI capabilities, having been done by the Csound developers already. Documentation is here and there, and Csoun

Re: Database specialized in storing directed graphs?

2008-10-28 Thread bearophileHUGS
Sorry Carl Banks for the answering delay, there are problems in Google Groups. > This is not to study graph theory; I'm using the graph to represent a > problem domain. The graphs could be arbitrarily large, and could > easily have millions of nodes, and most nodes have a substantial > amount of

Re: Database specialized in storing directed graphs?

2008-10-28 Thread George Sakkis
On Oct 27, 8:32 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > I was wondering if anyone had any advice on this. > > This is not to study graph theory; I'm using the graph to represent a > problem domain.  The graphs could be arbitrarily large, and could > easily have millions of nodes, and most node

Re: using modules in destructors

2008-10-28 Thread MRAB
On Oct 27, 5:40 pm, Scott David Daniels <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > It seems to me that deleting local instances before imported modules > > would solve the problem. Is it not possible for the interpreter to get > > this right? Or are there cases where this would break

Re: explanation of values, references, assignment, and method calls

2008-10-28 Thread Bruno Desthuilliers
Joe Strout a écrit : I've tried to write up this topic in a clear, step-by-step manner, with the help of diagrams and short examples from several different OOP languages. I hope it will help clear up the confusion that seems to be pervading the Python community May I suggest http://effbot.or

Extracting name strings from assigned objects

2008-10-28 Thread Shannon Mayne
I would like to ask how one might obtain the assigned name of an assigned object as a string. I would like to use object names as an algorithmic input. To demonstrate... So if i have: >>foo = {} what can I do to the object 'foo' so as to return the string 'foo'? Thanks! -- http://mail.python.o

Re: Unit Testing: a couple of questions

2008-10-28 Thread Orestis Markou
For the first bit, a colleague has recently asked the philosophical question, "How do you test what happens when the power goes down?" :) In other words, only test the bits that your code does. If you want to provide type checking, then yes, you have to test that. It's fair to assume that everyth

explanation of values, references, assignment, and method calls

2008-10-28 Thread Joe Strout
I've tried to write up this topic in a clear, step-by-step manner, with the help of diagrams and short examples from several different OOP languages. I hope it will help clear up the confusion that seems to be pervading the Python community (and which is far more rare in the other language

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Andy O'Meara
On Oct 27, 10:55 pm, Glenn Linderman <[EMAIL PROTECTED]> wrote: > And I think we still are miscommunicating!  Or maybe communicating anyway! > > So when you said "object", I actually don't know whether you meant > Python object or something else.  I assumed Python object, which may not > have bee

Re: list versions of all installed modules

2008-10-28 Thread Scott David Daniels
John [H2O] wrote: Is there a quick way to list the version of each installed module? import sys for name, module in sorted(sys.modules.items()): if hasattr(module, '__version__'): print name, module.__version__ Of course if you add __VERSION__, VERSION, and version, you may get mor

Re: parse a table in HTML page.

2008-10-28 Thread Thomas Guettler
Have you looked at beautiful soup? http://www.crummy.com/software/BeautifulSoup/ antonio_wn8 schrieb: > Hi all, > I have a need to read and parse a table in HTML page. > > I’m using the following script: > http://trac.davidgrant.ca/browser/src/python/misc/siteuptime/TableParser.py > > It works f

Re: Unit Testing: a couple of questions

2008-10-28 Thread Antoine De Groote
I'm wondering if don't want your class to look something like this: class myClass(): def __init__(self, data): self.__data = data def getData(self): return self.__data def setData(self, data): self.__data = data For the rest I'll let the experts argue, I don

Re: list versions of all installed modules

2008-10-28 Thread Gerhard Häring
John [H2O] wrote: Is there a quick way to list the version of each installed module? $ sudo easy_install yolk $ yolk -l -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary

2008-10-28 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > > I don't ever remember programming to cope with equipment failure, > however. Did you make that bit up? Not at the bit level in my case - but I do remember doing silly things like multiplying after a divide (all integer arithmetic) to make sure the

Re: Need advice/suggestion for small project

2008-10-28 Thread Scott David Daniels
AEB wrote: Hello, my supervisor has requested that I write a program to display 2D waves in 3D using Python. Basically I have a time series file that has the heights of the wave over time steps, and I want to extrude these waves lengthwise so that they appear in a 3D manor. I am not very famili

Re: Python barcode decoding

2008-10-28 Thread Kirk Strauser
At 2008-10-24T17:05:25Z, Robocop <[EMAIL PROTECTED]> writes: > Does anyone know of any decent (open source or commercial) python > barcode recognition tools or libraries. I need to read barcodes from > pdfs or images, so it will involve some OCR algorithm. I also only > need to read the code 93

Re: Finding the instance reference of an object

2008-10-28 Thread Joe Strout
On Oct 27, 2008, at 11:28 PM, Gabriel Genellina wrote: En Tue, 28 Oct 2008 00:58:10 -0200, greg <[EMAIL PROTECTED]> escribió: Let's look at the definitions of the terms: (1) Call by value: The actual parameter is an expression. It is evaluated and the result is assigned to the formal par

Re: Unpacking byte strings from a file of unknown size

2008-10-28 Thread Scott David Daniels
Mark wrote: Thanks I tested your solution and that works. One of the things that didn't work was for chunk in myfile.read(10): info1, info2, info3 = struct.unpack(' this code python interprets as: data = myfile.read(10) for chunk in data: . --Scott David Daniels [EMAIL PR

Re: Question about scope

2008-10-28 Thread Kirk Strauser
At 2008-10-24T01:08:12Z, Pat <[EMAIL PROTECTED]> writes: > ---> myGlobals.py file: > > class myGlobals(): > remote_device_enabled = bool > > ---> my initialize.py file: > > from myGlobals import * > def initialize(): > myGlobals.remote_device_enabled = True > > ---> my main.py file: > > im

Re: Python 2.5 + sqlite full text search possible?

2008-10-28 Thread Gerhard Häring
Guillermo wrote: Hi! Is it possible to use the full-text module of SQLite with the sqlite3 module? I've done a bit of investigation and it seems the stand-alone distribution of SQLite is compiled without it, Yes, though compiling using the amalgamation and defining SQLITE_ENABLE_FTS3 helps.

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Andy O'Meara
On Oct 25, 9:46 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > These discussion pop up every year or so and I think that most of them > are not really all that necessary, since the GIL isn't all that bad. > Thing is, if the topic keeps coming up, then that may be an indicator that change is trul

Re: Python 2.5 + sqlite full text search possible?

2008-10-28 Thread Guilherme Polo
On 10/28/08, Guillermo <[EMAIL PROTECTED]> wrote: > Hi! > > Is it possible to use the full-text module of SQLite with the sqlite3 > module? I've done a bit of investigation and it seems the stand-alone > distribution of SQLite is compiled without it, and so does the version > bundled with Pytho

Re: How to get an object's name as a string?

2008-10-28 Thread Joe Strout
On Oct 28, 2008, at 8:41 AM, Shannon Mayne wrote: I would like to create objects with algorithmically determined names based on other object names and use object names for general algorithm input. What do you mean by the "name" of an object? Objects don't generally have names, unless you ex

Re: dictionary

2008-10-28 Thread D'Arcy J.M. Cain
On Tue, 28 Oct 2008 10:06:31 -0400 Steve Holden <[EMAIL PROTECTED]> wrote: > Bizarre though it may sound in this age of integrated circuits there > really was a storage device that used a cathode ray tube to store (IIRC) > a kilobit of information. It detected, by the use of a capacitance plate A

list versions of all installed modules

2008-10-28 Thread John [H2O]
Is there a quick way to list the version of each installed module? -- View this message in context: http://www.nabble.com/list-versions-of-all-installed-modules-tp20204095p20204095.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/lis

ignoring NAs in a dataset with numpy

2008-10-28 Thread mrafi
Hey All, I am working with numpy I have a data set with a lot of nan values, and i want to calculate standard deviation is there a direct function to do it for example nansum(or something like this), to calculate standard deviation ignoring nan values?? Thanks Rafi -- View this message in contex

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Greg Ewing
Glenn Linderman wrote: So your 50% number is just a scare tactic, it would seem, based on wild guesses. Was there really any benefit to the comment? All I was really trying to say is that it would be a mistake to assume that the overhead will be negligible, as that would be just as much a wil

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Andy O'Meara
On Oct 27, 4:05 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Andy O'Meara wrote: > > > Well, when you're talking about large, intricate data structures > > (which include opaque OS object refs that use process-associated > > allocators), even a shared memory region between the child process

Re: How to get an object's name as a string?

2008-10-28 Thread Larry Bates
Shannon Mayne wrote: I would like to create objects with algorithmically determined names based on other object names and use object names for general algorithm input. How would one extract the name of an object from an object instance as a string. I would think that it is stored as an attribute

Unit Testing: a couple of questions

2008-10-28 Thread Emanuele D'Arrigo
Hi everybody, I'm just having a go with Unit Testing for the first time and my feeling about it in short is: Neat! I'm a bit worried about the time it's taking me to develop the tests but after only a day or so I'm already much faster than when I started with it and the code is already much impro

parse a table in HTML page.

2008-10-28 Thread antonio_wn8
Hi all, I have a need to read and parse a table in HTML page. I’m using the following script: http://trac.davidgrant.ca/browser/src/python/misc/siteuptime/TableParser.py It works fine aside from link in href. Example: String to parse: elognormal text Output: [[['elog', 'normal text']]] as y

Re: Unpacking byte strings from a file of unknown size

2008-10-28 Thread Mark
Thanks I tested your solution and that works. One of the things that didn't work was for chunk in myfile.read(10): info1, info2, info3 = struct.unpack('http://mail.python.org/mailman/listinfo/python-list

How to get an object's name as a string?

2008-10-28 Thread Shannon Mayne
I would like to create objects with algorithmically determined names based on other object names and use object names for general algorithm input. How would one extract the name of an object from an object instance as a string. I would think that it is stored as an attribute of the object but succ

Re: dictionary

2008-10-28 Thread Steve Holden
D'Arcy J.M. Cain wrote: > On Tue, 28 Oct 2008 10:06:31 -0400 > Steve Holden <[EMAIL PROTECTED]> wrote: >> Bizarre though it may sound in this age of integrated circuits there >> really was a storage device that used a cathode ray tube to store (IIRC) >> a kilobit of information. It detected, by the

  1   2   >