ANN: Leo 4.7 rc1 released

2010-02-13 Thread Edward K Ream
Leo 4.7 release candidate 1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo 4.7 rc 1 fixes all known serious bugs in Leo; minor nits remain. Leo is a text editor, data organizer, project manager and much more. See:

Release of CodeInvestigator 0.22.0

2010-02-13 Thread hans moleman
CodeInvestigator 0.22.0 was released on Feb 13. I have changed the recording process to make it run faster. CodeInvestigator is a tracing tool for Python programs. Running a program through CodeInvestigator creates a recording. Program flow, function calls, variable values and conditions are

Re: How do you implement a Progress Bar

2010-02-13 Thread Sean DiZazzo
On Feb 12, 11:33 pm, J Wolfe vorticitywo...@gmail.com wrote: I would really appreciate some help with this.  I'm fairly new to using classes...What am I doing wrong? All I get is a blank window. I can't seem to figure out how to initialize this Progress Bar. Study and hack on this:

Re: Modifying Class Object

2010-02-13 Thread Stephen Hansen
On Fri, Feb 12, 2010 at 6:23 PM, rantingrick rantingr...@gmail.com wrote: [blah, blah, blah] First of all, we all know how D Aprano has such an unfettered ego problem. [blah, blah, blah] And as always the roaches start coming out of the woodwork in a most pathetic puppy dog way. What would

Re: Function attributes

2010-02-13 Thread Steve Howell
On Feb 10, 5:59 am, Muhammad Alkarouri malkaro...@gmail.com wrote: Hi everyone, What is the simplest way to access the attributes of a function from inside it, other than using its explicit name? In a function like f below: def f(*args):     f.args = args     print args is there any

plugin / intra process communication system

2010-02-13 Thread Florian Ludwig
Hi, I'm looking for a module/plugin/intra-process-communication/hook system for python. Maybe someone here could point me to some project I missed or might have some good ideas if I end up implementing it myself. Most systems I have found are one to many communications but I would like many to

Re: python crash on windows but not on linux

2010-02-13 Thread Peter Otten
hjebbers wrote: On Feb 12, 3:17 pm, Peter Otten __pete...@web.de wrote: hjebbers wrote: On Feb 11, 7:01 pm, Peter Otten __pete...@web.de wrote: hjebbers wrote: On Feb 11, 5:45 pm, M3RT mgul...@gmail.com wrote: The problem may be related to how you treat the EDI file or lets say

bsddb version mysmatch between win32 and linux

2010-02-13 Thread Expo
Hi guys, I found an incompatibility in the bsddb library shipped with Python which is a different version between the win32 release and the linux release. This happend using Python 2.6.2 on win32 and OpenSuse 11.2. To reproduce this problem, create a bsddb file under win32 with this code: import

Re: python crash on windows but not on linux

2010-02-13 Thread hjebbers
On Feb 12, 11:46 pm, Rob Williscroft r...@rtw.me.uk wrote: hjebbers wrote in news:2864756a-292b-4138-abfd- 3348b72b7...@u9g2000yqb.googlegroups.com in comp.lang.python: the information about the error is a windows dump. This may help:

Re: python crash on windows but not on linux

2010-02-13 Thread hjebbers
On Feb 13, 11:03 am, Peter Otten __pete...@web.de wrote: hjebbers wrote: On Feb 12, 3:17 pm, Peter Otten __pete...@web.de wrote: hjebbers wrote: On Feb 11, 7:01 pm, Peter Otten __pete...@web.de wrote: hjebbers wrote: On Feb 11, 5:45 pm, M3RT mgul...@gmail.com wrote: The problem

Re: python crash on windows but not on linux

2010-02-13 Thread hjebbers
On Feb 13, 10:25 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 12 Feb 2010 09:21:07 -0800 (PST), hjebbers hjebb...@gmail.com declaimed the following in gmane.comp.python.general: What strikes me is: 1. the crash on windows, but linux works OK (same test sets) 2. the linux box

Re: Function attributes

2010-02-13 Thread Mark Lawrence
Gabriel Genellina wrote: En Fri, 12 Feb 2010 04:29:12 -0300, Arnaud Delobelle arno...@googlemail.com escribió: I posted an example of a decorator that does just this in this thread a couple of days ago: http://mail.python.org/pipermail/python-list/2010-February/1235742.html Ouch! I didn't

Re: python crash on windows but not on linux

2010-02-13 Thread hjebbers
to all, thanks for the pointers so far. if you feel the need to reproduce the crash, it's not that hard, (downloading and installing my edi translator, install configuration (button-click), and run. I have a modified version (replace some *.py files) that eliminate a lot of stuff (simpler setup,

Re: python crash on windows but not on linux

2010-02-13 Thread Diez B. Roggisch
Am 13.02.10 11:50, schrieb hjebbers: On Feb 13, 10:25 am, Dennis Lee Bieberwlfr...@ix.netcom.com wrote: On Fri, 12 Feb 2010 09:21:07 -0800 (PST), hjebbershjebb...@gmail.com declaimed the following in gmane.comp.python.general: What strikes me is: 1. the crash on windows, but linux works OK

Re: python crash on windows but not on linux

2010-02-13 Thread hjebbers
On Feb 13, 12:24 pm, Diez B. Roggisch de...@nospam.web.de wrote: Am 13.02.10 11:50, schrieb hjebbers: On Feb 13, 10:25 am, Dennis Lee Bieberwlfr...@ix.netcom.com  wrote: On Fri, 12 Feb 2010 09:21:07 -0800 (PST), hjebbershjebb...@gmail.com declaimed the following in

Re: python crash on windows but not on linux

2010-02-13 Thread Alf P. Steinbach
* hjebbers: I enlarged the windows page file from 750Kb to 1.5Gb . The crash still happens. btw, the crash does not happen at a peak memory usage. According to windows task manager, at the moment of crash mem usage of my program is 669kb, peak memory usage is 1.136kb henk-jan Probably you

Re: python crash on windows but not on linux

2010-02-13 Thread hjebbers
On Feb 13, 10:25 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 12 Feb 2010 09:21:07 -0800 (PST), hjebbers hjebb...@gmail.com declaimed the following in gmane.comp.python.general: What strikes me is: 1. the crash on windows, but linux works OK (same test sets) 2. the linux box

how do I write a scliceable class?

2010-02-13 Thread Ernest Adrogué
Hello everybody, I'm designing a container class that supports slicing. The problem is that I don't really know how to do it. class MyClass(object): def __init__(self, input_data): self._data = transform_input(input_data) def __getitem__(self, key):

Re: python crash on windows but not on linux

2010-02-13 Thread Dave Angel
hjebbers wrote: On Feb 13, 10:25 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 12 Feb 2010 09:21:07 -0800 (PST), hjebbers hjebb...@gmail.com declaimed the following in gmane.comp.python.general: What strikes me is: 1. the crash on windows, but linux works OK (same test

Re: Function attributes [OT]

2010-02-13 Thread Steve Holden
Mark Lawrence wrote: Gabriel Genellina wrote: En Fri, 12 Feb 2010 04:29:12 -0300, Arnaud Delobelle arno...@googlemail.com escribió: I posted an example of a decorator that does just this in this thread a couple of days ago:

Re: how do I write a scliceable class?

2010-02-13 Thread Alf P. Steinbach
* Ernest Adrogué: Hello everybody, I'm designing a container class that supports slicing. The problem is that I don't really know how to do it. class MyClass(object): def __init__(self, input_data): self._data = transform_input(input_data) def __getitem__(self,

Re: Function attributes [OT]

2010-02-13 Thread Mark Lawrence
Steve Holden wrote: Mark Lawrence wrote: Gabriel Genellina wrote: En Fri, 12 Feb 2010 04:29:12 -0300, Arnaud Delobelle arno...@googlemail.com escribió: I posted an example of a decorator that does just this in this thread a couple of days ago:

Re: how do I write a scliceable class?

2010-02-13 Thread Diez B. Roggisch
Am 13.02.10 13:51, schrieb Ernest Adrogué: Hello everybody, I'm designing a container class that supports slicing. The problem is that I don't really know how to do it. class MyClass(object): def __init__(self, input_data): self._data = transform_input(input_data)

Re: how do I write a scliceable class?

2010-02-13 Thread Peter Otten
Ernest Adrogué wrote: I'm designing a container class that supports slicing. The problem is that I don't really know how to do it. class MyClass(object): def __init__(self, input_data): self._data = transform_input(input_data) def __getitem__(self, key):

Re: how do I write a scliceable class?

2010-02-13 Thread Ernest Adrogué
Hi, Thanks a lot for your comments. I think I've got enough information to make a decision now. 13/02/10 @ 15:16 (+0100), thus spake Peter Otten: Ernest Adrogué wrote: I'm designing a container class that supports slicing. The problem is that I don't really know how to do it. class

Re: concatenate fasta file

2010-02-13 Thread Grant Edwards
On 2010-02-12, PeroMHC macma...@gmail.com wrote: Hi All, I have a simple problem that I hope somebody can help with. I have an input file (a fasta file) that I need to edit.. Input file format name 1 tactcatacatac name 2 acggtggcat name 3 gggtaccacgtt I need to concatenate the

Re: Create a backslash-escaped version of a string?

2010-02-13 Thread Aahz
In article aa6966f8-4dda-4e5b-ab7c-828faaff6...@36g2000yqu.googlegroups.com, boblatest boblat...@googlemail.com wrote: I'd like to have control characters in a string to be converted to their backslash-escaped counterparts. I looked in the encoders section of the string module but couldn't find

Re: Modifying Class Object

2010-02-13 Thread Aahz
In article mailman.2323.1265836683.28905.python-l...@python.org, Steve Holden st...@holdenweb.com wrote: Whether in CPython, Jython or IronPython the value returned by calling id(x) (whether x is a literal, a simple name or a more complex expression) is absolutely no use as an accessor: it does

Re: Modifying Class Object

2010-02-13 Thread Aahz
In article mailman.2489.1266053149.28905.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 12 Feb 2010 18:23:46 -0800 (PST), rantingrick rantingr...@gmail.com declaimed the following in gmane.comp.python.general: This entire thread has imploded like a neutron star

Re: Modifying Class Object

2010-02-13 Thread Michael Sparks
Hi Alf, On Feb 12, 8:22 pm, Alf P. Steinbach al...@start.no wrote: Thanks for the effort at non-flaming discussion, it *is* appreciated. I would appreciate it if you tried to be non-flaming yourself, since you can see I am not flaming you. I was seeking to educate you on a simple matter

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Aahz: In article mailman.2323.1265836683.28905.python-l...@python.org, Steve Holden st...@holdenweb.com wrote: Whether in CPython, Jython or IronPython the value returned by calling id(x) (whether x is a literal, a simple name or a more complex expression) is absolutely no use as an

Re: how do I write a scliceable class?

2010-02-13 Thread Robert Kern
On 2010-02-13 06:51 , Ernest Adrogué wrote: Hello everybody, I'm designing a container class that supports slicing. The problem is that I don't really know how to do it. class MyClass(object): def __init__(self, input_data): self._data = transform_input(input_data)

threading and signals - main thread solely responsible for signal handling?

2010-02-13 Thread Maligree
The main part of my script is a function that does many long reads (urlopen, it's looped). Since I'm hell-bent on employing SIGINFO to display some stats, I needed to run foo() as a seperate thread to avoid getting errno 4 (interrupted system call) errors (which occur if SIGINFO is received while

multiprocessing and games

2010-02-13 Thread Brian Blais
Hello, I've been thinking about implementing some simple games, where one can program agents to play the game. I thought that the multiprocessing module would be perfect for it, organized with a main simulator engine spawning processes for each agent. However, I am having trouble

Re: threading and signals - main thread solely responsible for signal handling?

2010-02-13 Thread MRAB
Maligree wrote: The main part of my script is a function that does many long reads (urlopen, it's looped). Since I'm hell-bent on employing SIGINFO to display some stats, I needed to run foo() as a seperate thread to avoid getting errno 4 (interrupted system call) errors (which occur if SIGINFO

Re: threading and signals - main thread solely responsible for signal handling?

2010-02-13 Thread exarkun
On 04:43 pm, malig...@gmail.com wrote: The main part of my script is a function that does many long reads (urlopen, it's looped). Since I'm hell-bent on employing SIGINFO to display some stats, I needed to run foo() as a seperate thread to avoid getting errno 4 (interrupted system call) errors

Re: multiprocessing and games

2010-02-13 Thread MRAB
Brian Blais wrote: Hello, I've been thinking about implementing some simple games, where one can program agents to play the game. I thought that the multiprocessing module would be perfect for it, organized with a main simulator engine spawning processes for each agent. However, I am

Re: MemoryError, can I use more?

2010-02-13 Thread Anssi Saari
Diez B. Roggisch de...@nospam.web.de writes: Am 13.02.10 17:18, schrieb Anssi Saari: Nobodynob...@nowhere.com writes: A single process can't use much more than 2GiB of RAM without a 64-bit CPU and OS. That's not really true. Even Windows XP has the /3GB boot option to allow 3 GiB per

MemoryError in imaplib?

2010-02-13 Thread Márcio Faustino
Hi, When using imaplib to fetch e-mail messages, the IMAP4_SSL.read and IMAP4_SSL.readline functions sometimes throw a MemoryError exception in chunks.append(data) and line.append(char), respectively. But if I change those functions to use instead a cStringIO buffer object, then that exception

Py3: Terminal or browser output?

2010-02-13 Thread Gnarlodious
Hello, searched all over but no success. I want to have a script output HTML if run in a browser and plain text if run in a Terminal. In Python 2, I just said this: if len(sys.argv)==True: and it seemed to work. Py3 must have broken that by sending a list with the path to the script in BOTH the

Re: how to make a SimpleXMLRPCServer abort at CTRL-C under windows

2010-02-13 Thread News123
Hi Gabriel, News123 wrote: Hi Gabriel, Gabriel Genellina wrote: En Fri, 05 Feb 2010 20:03:51 -0300, News123 news...@free.fr escribió: I'm using an XMLRPC server under Windows. What I wonder is how I could create a server, that can be killed with CTRL-C The server aborts easily with

Re: python and http POST

2010-02-13 Thread galileo228
Thank you all for your responses, and Javier thank you for your longer response. I've just downloaded mechanize and beautifulsoup and will start to play around. From a pure learning standpoint, however, I'd really like to learn how to use the python post method (without mechanize) to go to a

Re: Py3: Terminal or browser output?

2010-02-13 Thread Chris Rebert
On Sat, Feb 13, 2010 at 11:46 AM, Gnarlodious gnarlodi...@gmail.com wrote: Hello, searched all over but no success. I want to have a script output HTML if run in a browser and plain text if run in a Terminal. In Python 2, I just said this: if len(sys.argv)==True: That line doesn't make sense

Re: python and http POST

2010-02-13 Thread galileo228
Thank you all for your responses, and Javier thank you for your longer response. I've just downloaded mechanize and beautifulsoup and will start to play around. From a pure learning standpoint, however, I'd really like to learn how to use the python post method (without mechanize) to go to a

Re: Py3: Terminal or browser output?

2010-02-13 Thread Diez B. Roggisch
Am 13.02.10 20:46, schrieb Gnarlodious: Hello, searched all over but no success. I want to have a script output HTML if run in a browser and plain text if run in a Terminal. In Python 2, I just said this: if len(sys.argv)==True: and it seemed to work. Py3 must have broken that by sending a

Re: Py3: Terminal or browser output?

2010-02-13 Thread Gnarlodious
On Feb 13, 1:17 pm, Diez B. Roggisch wrote: However, maybe if os.isatty(sys.stdout.fileno()): OK, this works in Python 2: #!/usr/bin/python import sys, os if __name__==__main__: if os.isatty(sys.stdout.fileno()): print Terminal else: print Content-type:text/html\n\nBROWSER likewise

Re: python and http POST

2010-02-13 Thread galileo228
Thank you all for your responses, and Javier thank you for your longer response. I've just downloaded mechanize and beautifulsoup and will start to play around. From a pure learning standpoint, however, I'd really like to learn how to use the python post method (without mechanize) to go to a

Re: Py3: Terminal or browser output?

2010-02-13 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gnarlodious wrote: I want to have a script output HTML if run in a browser and plain text if run in a Terminal. You may also want to look into urwid. It provides you with a text console interface but can also provide HTML. It has widgets like

Re: multiprocessing and games

2010-02-13 Thread Brian Blais
On Feb 13, 2010, at 12:54 , MRAB wrote: Brian Blais wrote: I've been thinking about implementing some simple games Forget about global variables, they're not worth it! :-) Think in terms of messages, sent via pipes, sockets or multiprocessing queues. okay...let's make this concrete.

Re: Py3: Terminal or browser output?

2010-02-13 Thread John Bokma
Gnarlodious gnarlodi...@gmail.com writes: Hello, searched all over but no success. I want to have a script output HTML if run in a browser and plain text if run in a Terminal. In Python 2, I just said this: if len(sys.argv)==True: and it seemed to work. Py3 must have broken that by sending

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Michael Sparks: [Due to the appearance of reasoned discussion (it's not practical to read it all!), I felt it necessary to respond. It turned out to be a long sequence of trivial fallacies, peppered with various allegations and insinuations.] [snip extremely much] Now let's move to the

Hashing in python

2010-02-13 Thread Vish
Hi, I need to hash 3d coordinates to a grid which has been divided into 4*4*4 squares. Using python, I thought of a simple way as follows: CELL_SIZE = 4 def key(point): return ( int((floor(point[0]/CELL_SIZE))*CELL_SIZE), int((floor(point[1]/CELL_SIZE))*CELL_SIZE),

Re: Modifying Class Object

2010-02-13 Thread Steve Holden
Alf P. Steinbach wrote: * Michael Sparks: [Due to the appearance of reasoned discussion (it's not practical to read it all!) [...] Therefore to say in reality the implementation will be passing a reference or pointer is invalid. There is after all at least one implementation that does not

Re: Modifying Class Object

2010-02-13 Thread Steven D'Aprano
On Sat, 13 Feb 2010 07:59:42 -0800, Michael Sparks wrote: Now, if I define a language, this has 3 main parts: * Syntax * Semantics * Implementation [snip] Michael, that is remarkable. Excellent work, thank you! -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Hashing in python

2010-02-13 Thread MRAB
Vish wrote: Hi, I need to hash 3d coordinates to a grid which has been divided into 4*4*4 squares. Using python, I thought of a simple way as follows: CELL_SIZE = 4 def key(point): return ( int((floor(point[0]/CELL_SIZE))*CELL_SIZE),

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Michael Sparks: [Due to the appearance of reasoned discussion (it's not practical to read it all!) [...] Therefore to say in reality the implementation will be passing a reference or pointer is invalid. There is after all at least one implementation

working with laptop battery

2010-02-13 Thread Daniel Dalton
Hi, I'm constantly working in the command line and need to write a program to give me alerts on my battery. Can someone please tell me what module I should use to access battery information? Looking for something that perhaps makes use of acpi so I can get estimated time left as well as a

Re: Modifying Class Object

2010-02-13 Thread Mark Lawrence
Alf P. Steinbach wrote: * Steve Holden: Alf P. Steinbach wrote: * Michael Sparks: [Due to the appearance of reasoned discussion (it's not practical to read it all!) [...] Therefore to say in reality the implementation will be passing a reference or pointer is invalid. There is after all at

Re: Modifying Class Object

2010-02-13 Thread Benjamin Kaplan
On Sat, Feb 13, 2010 at 7:50 PM, Alf P. Steinbach al...@start.no wrote: At this point consider whether it's possible to implement Pascal in Haskell. If it is possible, then you have a problem wrt. drawing conclusions about pointers in Pascal, uh oh, they apparently can't exist. But if it is

Re: working with laptop battery

2010-02-13 Thread Chris Rebert
On Sat, Feb 13, 2010 at 4:48 PM, Daniel Dalton d.dal...@iinet.net.au wrote: Hi, I'm constantly working in the command line and need to write a program to give me alerts on my battery. Can someone please tell me what module I should use to access battery information? Looking for something that

Re: Selecting a file in a directory

2010-02-13 Thread Alf P. Steinbach
* vsoler: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs to work on in as much the same way as I open a .xls file in Excel, that is, I want to make appear the Windows' window and let the user choose.

Re: working with laptop battery

2010-02-13 Thread Shashwat Anand
I too am interested as to which module should I use. My OS is OS X Snow Leopard. On Sun, Feb 14, 2010 at 6:56 AM, Chris Rebert c...@rebertia.com wrote: On Sat, Feb 13, 2010 at 4:48 PM, Daniel Dalton d.dal...@iinet.net.au wrote: Hi, I'm constantly working in the command line and need to

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Benjamin Kaplan: On Sat, Feb 13, 2010 at 7:50 PM, Alf P. Steinbach al...@start.no wrote: At this point consider whether it's possible to implement Pascal in Haskell. If it is possible, then you have a problem wrt. drawing conclusions about pointers in Pascal, uh oh, they apparently can't

Re: threading and signals - main thread solely responsible for signal handling?

2010-02-13 Thread Cameron Simpson
On 13Feb2010 17:22, exar...@twistedmatrix.com exar...@twistedmatrix.com wrote: | On 04:43 pm, malig...@gmail.com wrote: | The main part of my script is a function that does many long reads | (urlopen, it's looped). Since I'm hell-bent on employing SIGINFO to | display some stats, I needed to run

Re: Selecting a file in a directory

2010-02-13 Thread vsoler
On Feb 14, 2:28 am, Alf P. Steinbach al...@start.no wrote: * vsoler: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs to work on in as much the same way as I open a .xls file in Excel, that

Re: working with laptop battery

2010-02-13 Thread Daniel Dalton
On Sat, Feb 13, 2010 at 05:26:02PM -0800, Chris Rebert wrote: It's probably gonna depend on which OS you're running. Which would be...? Sorry, forgot to mention this. I'm running debian linux. Thanks, Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Steve Howell: This thread is interesting on many levels. What is the core question that is being examined here? I think that regarding the technical it is whether a Python name refers to an object or not. I maintain that it does, and that the reference can be copied, and that the

Re: Modifying Class Object

2010-02-13 Thread Steve Holden
Alf P. Steinbach wrote: * Steve Holden: Alf P. Steinbach wrote: * Michael Sparks: [Due to the appearance of reasoned discussion (it's not practical to read it all!) [...] Therefore to say in reality the implementation will be passing a reference or pointer is invalid. There is after all at

Re: Selecting a file in a directory

2010-02-13 Thread Steven D'Aprano
On Sat, 13 Feb 2010 17:21:51 -0800, vsoler wrote: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs to work on in as much the same way as I open a .xls file in Excel, that is, I want to make appear

Re: Selecting a file in a directory

2010-02-13 Thread rantingrick
On Feb 13, 7:28 pm, Alf P. Steinbach al...@start.no wrote: * vsoler: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs to work on in as much the same way as I open a .xls file in Excel, that

Re: multiprocessing and games

2010-02-13 Thread MRAB
Brian Blais wrote: On Feb 13, 2010, at 12:54 , MRAB wrote: Brian Blais wrote: I've been thinking about implementing some simple games Forget about global variables, they're not worth it! :-) Think in terms of messages, sent via pipes, sockets or multiprocessing queues. okay...let's

Re: Selecting a file in a directory

2010-02-13 Thread vsoler
On Feb 14, 2:45 am, rantingrick rantingr...@gmail.com wrote: On Feb 13, 7:28 pm, Alf P. Steinbach al...@start.no wrote: * vsoler: Hi, My python script needs to work with a .txt file in a directory. I would like to give the user the possibility to choose the file he needs to

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: Alf P. Steinbach wrote: * Michael Sparks: [Due to the appearance of reasoned discussion (it's not practical to read it all!) [...] Therefore to say in reality the implementation will be passing a reference or pointer is invalid. There

Re: Modifying Class Object

2010-02-13 Thread MRAB
Alf P. Steinbach wrote: * Steve Howell: This thread is interesting on many levels. What is the core question that is being examined here? I think that regarding the technical it is whether a Python name refers to an object or not. I maintain that it does, and that the reference can be

Re: working with laptop battery

2010-02-13 Thread Chris Colbert
You'll need acpi installed: In [6]: import subprocess In [7]: p = subprocess.Popen('acpi', stdout=subprocess.PIPE) In [8]: output, errors = p.communicate() In [9]: print output -- print(output) Battery 0: Full, 100%, rate information unavailable On Sat, Feb 13, 2010 at 8:43 PM, Daniel

Re: working with laptop battery

2010-02-13 Thread Daniel Fetchinson
It's probably gonna depend on which OS you're running. Which would be...? Sorry, forgot to mention this. I'm running debian linux. I don't know about python modules but have a look at /proc/acpi/battery/BAT0/info /proc/acpi/battery/BAT0/state You can parse the numbers you want from there.

Re: working with laptop battery

2010-02-13 Thread Tim Chase
Daniel Dalton wrote: On Sat, Feb 13, 2010 at 05:26:02PM -0800, Chris Rebert wrote: It's probably gonna depend on which OS you're running. Which would be...? Sorry, forgot to mention this. I'm running debian linux. You should be able to read/poll the various files in

Re: To (monkey)patch or not to (monkey)patch, that is the question

2010-02-13 Thread Aahz
In article 1410d2e2-a6f2-4b6c-a745-6d3e34994...@q16g2000yqq.googlegroups.com, George Sakkis george.sak...@gmail.com wrote: I was talking to a colleague about one rather unexpected/undesired (though not buggy) behavior of some package we use. Although there is an easy fix (or at least

Re: Modifying Class Object

2010-02-13 Thread Aahz
In article hl6ilk$f7...@news.eternal-september.org, Alf P. Steinbach al...@start.no wrote: My original statement, with reference to the Java language spec, didn't say much more about the language than that it has assignable references. Assuming this is what you're referring to: Python

Re: Selecting a file in a directory

2010-02-13 Thread rantingrick
On Feb 13, 8:00 pm, vsoler vicente.so...@gmail.com wrote: On Feb 14, 2:45 am, rantingrick rantingr...@gmail.com wrote: (..snip..) Excellent!!! Just what I needed! For your case, since it seems you are writing a console type application you may want to subdue the root window and show the user

Re: Modifying Class Object

2010-02-13 Thread Steve Howell
On Feb 13, 6:41 pm, a...@pythoncraft.com (Aahz) wrote: In article hl6ilk$f7...@news.eternal-september.org, Alf P. Steinbach al...@start.no wrote: My original statement, with reference to the Java language spec, didn't say much more about the language than that it has assignable references.

Re: Modifying Class Object

2010-02-13 Thread Steve Howell
On Feb 13, 6:10 pm, MRAB pyt...@mrabarnett.plus.com wrote: Alf P. Steinbach wrote: * Steve Howell: This thread is interesting on many levels.  What is the core question that is being examined here? I think that regarding the technical it is whether a Python name refers to an object or

Re: Sorting a list of lists

2010-02-13 Thread R (Chandra) Chandrasekhar
MRAB wrote: You'd have to post an example of that, but you could try deleting some of the entries before sorting so see whether you can still reproduce the problem with a smaller list. John Posner wrote: Please cut-and-paste the exact error message (or other evidence of failure) into a

Re: search entire drive say c:

2010-02-13 Thread Tim Golden
On 12/02/2010 12:17, prakash jp wrote: Hi all, can any of u help to search a file say abc.txt in entire c drive (windows) and print the path/s stating such a files presence. This sounds rather like homework... Have a look at os.walk TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: How to measure elapsed time under Windows?

2010-02-13 Thread Tim Roberts
Gabriel Genellina gagsl-...@yahoo.com.ar wrote: The original problem was with the RDTSC instruction on multicore CPUs; different cores may yield different results because they're not synchronized at all times. Not true. The synchronization issue has two causes: initial synchronization at

Re: MemoryError, can I use more?

2010-02-13 Thread Anssi Saari
Nobody nob...@nowhere.com writes: A single process can't use much more than 2GiB of RAM without a 64-bit CPU and OS. That's not really true. Even Windows XP has the /3GB boot option to allow 3 GiB per process. On PCs, free operating systems and server Windows can use PAE to give access to full

Re: MemoryError, can I use more?

2010-02-13 Thread Diez B. Roggisch
Am 13.02.10 17:18, schrieb Anssi Saari: Nobodynob...@nowhere.com writes: A single process can't use much more than 2GiB of RAM without a 64-bit CPU and OS. That's not really true. Even Windows XP has the /3GB boot option to allow 3 GiB per process. On PCs, free operating systems and server

Re: Modifying Class Object

2010-02-13 Thread Bruno Desthuilliers
Alf P. Steinbach a écrit : (snip) This group has an extraordinary high level of flaming and personal attacks Oh my... (snip remaining non-sense) Mr Steinbach, I bet you'll count this as another flaming and personal attack, but nonetheless : you might have happier time if you were able to

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Bruno Desthuilliers: Alf P. Steinbach a écrit : (snip) This group has an extraordinary high level of flaming and personal attacks Oh my... (snip remaining non-sense) Mr Steinbach, I bet you'll count this as another flaming and personal attack, but nonetheless : you might have happier

Re: Modifying Class Object

2010-02-13 Thread Steven D'Aprano
On Fri, 12 Feb 2010 21:26:24 +0100, Alf P. Steinbach wrote: Yes, I do count this as a personal attack and flaming. The litmus test for that is that it says something very negative about the person you're debating with. As negative as accusing somebody of intentionally lying? Or is it only

Re: Modifying Class Object

2010-02-13 Thread Steve Howell
This thread is interesting on many levels. What is the core question that is being examined here? -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with MemoryError

2010-02-13 Thread rantingrick
On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : On Feb 12, 4:10 pm, Steve Holden st...@holdenweb.com wrote: Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit :

Replace various regex

2010-02-13 Thread Martin
Hi, I am trying to come up with a more generic scheme to match and replace a series of regex, which look something like this... 19.01,16.38,0.79,1.26,1.00 ! canht_ft(1:npft) 5.0, 4.0, 2.0, 4.0, 1.0 ! lai(1:npft) Ideally match the pattern to the right of the ! sign (e.g. lai), I would

Re: Modifying Class Object

2010-02-13 Thread Alf P. Steinbach
* Aahz: In article hl6ilk$f7...@news.eternal-september.org, Alf P. Steinbach al...@start.no wrote: My original statement, with reference to the Java language spec, didn't say much more about the language than that it has assignable references. Assuming this is what you're referring to:

Re: Modifying Class Object

2010-02-13 Thread Steven D'Aprano
On Sat, 13 Feb 2010 18:54:34 -0800, Steve Howell wrote: On Feb 13, 6:41 pm, a...@pythoncraft.com (Aahz) wrote: Regardless of how CPython manages its state internally, Python as a programming language does not have pointers.   I agree with your statement for a suitably narrow definition of

Re: Hashing in python

2010-02-13 Thread Paul Rubin
Vish vahu...@gmail.com writes: I need to hash 3d coordinates to a grid which has been divided into 4*4*4 squares. Using python, I thought of a simple way as follows: Use the built-in hash function: p = (1, 2, 3) print hash(p) 2528502973977326415 You can of course mod that by the

Re: Modifying Class Object

2010-02-13 Thread Steve Howell
On Feb 13, 7:53 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 13 Feb 2010 18:54:34 -0800, Steve Howell wrote: On Feb 13, 6:41 pm, a...@pythoncraft.com (Aahz) wrote: Regardless of how CPython manages its state internally, Python as a programming language does not

Re: ANN: ActivePython 2.5.5.7 is now available

2010-02-13 Thread Sridhar Ratnakumar
On 2010-02-13, at 1:25 AM, Dennis Lee Bieber wrote: On Thu, 11 Feb 2010 16:22:49 -0800, Sridhar Ratnakumar sridh...@activestate.com declaimed the following in gmane.comp.python.general: I'm happy to announce that ActivePython 2.5.5.7 is now available for download from:

Re: Modifying Class Object

2010-02-13 Thread Steven D'Aprano
On Sat, 13 Feb 2010 20:11:06 -0800, Steve Howell wrote: For a suitably wide definition of pointers CPython does indeed have pointers, and your example is only a weaker case of that truth. There is no reductio adsurbum. If I argued that CPython had curly braced syntax that would be absurd,

Re: Modifying Class Object

2010-02-13 Thread Steve Howell
On Feb 13, 9:13 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 13 Feb 2010 20:11:06 -0800, Steve Howell wrote: For a suitably wide definition of pointers CPython does indeed have pointers, and your example is only a weaker case of that truth.  There is no reductio

  1   2   >