Save the date: SciPy 2010 June 28 - July 3

2010-02-12 Thread Amenity Applewhite
The annual US Scientific Computing with Python Conference, SciPy, has been held at Caltech since it began in 2001. While we always love an excuse to go to California, it’s also important to make sure that we allow everyone an opportunity to attend the conference. So, as Jarrod Millman

ANN: ActivePython 2.5.5.7 is now available

2010-02-12 Thread Sridhar Ratnakumar
I'm happy to announce that ActivePython 2.5.5.7 is now available for download from: http://www.activestate.com/activepython/ This is a minor release with several updates and fixes. Changes in 2.5.5.7 -- - Upgrade to Python 2.5.5 - Upgrade to Tcl/Tk 8.5.8 - Upgrade to

Announce: Linux Desktop Testing Project (LDTP) 1.7.2 released

2010-02-12 Thread Nagappan Alagappan
Greetings all, We are proud to announce the release of LDTP 1.7.1. This release features number of important breakthroughs in LDTP as well as in the field of Test Automation. This release note covers a brief introduction on LDTP followed by the list of new features and major bug fixes which

SmartSweeper: exercise to write AI for minesweeper

2010-02-12 Thread Beni Cherniavsky
One day I was bored with MineSweeper not doing even simple analysis for me, and wrote it in Python. Then I realized it'd be nice as an exercise: I give you an implementation of dumb MineSweeper, with GUI, and you subclass it to make it smarter. It comes with a detailed document guiding you

Re: python and http POST

2010-02-12 Thread Javier Collado
Hello, I haven't used httplib2, but you can certainly use any other alternative to send HTTP requests: - urllib/urllib2 - mechanize With regard to how do you find the form you're looking for, you may: - create the HTTP request on your own with urllib2. To find out what variables do you need to

Re: ANN: obfuscate

2010-02-12 Thread Tim Golden
On 11/02/2010 11:32, Paul Rubin wrote: Gregory Ewinggreg.ew...@canterbury.ac.nz writes: Actually I gather it had a lot to do with the fact that the Germans made some blunders in the way they used the Enigma that seriously compromised its security. There was reportedly a branch of the German

Re: python crash on windows but not on linux

2010-02-12 Thread hjebbers
On Feb 11, 5:45 pm, M3RT mgul...@gmail.com wrote: Hi, The problem may be related to how you treat the EDI file or lets say DATA. Also your coding style is important. Can you provide more info? Yes, a whole lot more; but I do not want to bother you with that now. I was just wondering if it is

Re: ANN: obfuscate

2010-02-12 Thread Bob Martin
in 16 20100212 034121 Paul Rubin no.em...@nospam.invalid wrote: See http://en.wikipedia.org/wiki/Colossus_computer That was almost at the end of the war though. Colossus was working by the end of 1943 - the year that the Americans first dropped bombs on Germany ;-) -- http

Re: python crash on windows but not on linux

2010-02-12 Thread Peter Otten
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 DATA. Also your coding style is important. Can you provide more info? Yes, a whole lot more; but I do not want to bother you with that now. I was just

Re: ANN: obfuscate

2010-02-12 Thread Paul Rubin
Mark Lawrence breamore...@yahoo.co.uk writes: The predecessor of the Enigma was cracked by Polish scientists years before WW2 started I believe that all of Enigma was eventually cracked cos of two major flaws. I think it never would have been cracked if it hadn't been cracked (whether by

Re: Modifying Class Object

2010-02-12 Thread Martin P. Hellwig
cut all Well at least you are well written and more subtle than Xah Lee. Though I find him also quite amusing, I do like a good flame-war every now and again, and in that perspective I solute you. -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre arithmetic results

2010-02-12 Thread Grant Edwards
On 2010-02-11, Terrence Cole list-s...@trainedmonkeystudios.org wrote: Can someone explain to me what python is doing here? Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) [GCC 4.3.4] on linux2 Type help, copyright, credits or license for more information. -0.1 ** 0.1 -0.7943282347242815

Re: sqlite3 bug?

2010-02-12 Thread dads
Thank you It just highlights that when your tired things can easily be missed and maybe you should leave things until the morning to view things with fresh eyes =) -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre arithmetic results

2010-02-12 Thread Jussi Piitulainen
Terry Reedy writes: On 2/11/2010 11:23 AM, Jussi Piitulainen wrote: Robert Kern writes: On 2010-02-11 06:31 AM, Shashwat Anand wrote: There is a little issue here that ' -.1 ** .1' should give you error message. That is it. No, fractional powers of negative numbers are perfectly

Re: ANN: obfuscate

2010-02-12 Thread Jean-Michel Pichavant
Bob Martin wrote: in 16 20100212 034121 Paul Rubin no.em...@nospam.invalid wrote: See http://en.wikipedia.org/wiki/Colossus_computer That was almost at the end of the war though. Colossus was working by the end of 1943 - the year that the Americans first dropped bombs

Re: Any way to turn off exception handling? (debugging)

2010-02-12 Thread Vinay Sajip
On Feb 11, 7:12 pm, mk mrk...@gmail.com wrote: Peter Otten wrote: try:    ... except socket.error:    ... #untested import socket class SocketWrapper:     def __getattr__(self, name):         return getattr(socket, name)     error = None import module_using_socket

Re: python crash on windows but not on linux

2010-02-12 Thread hjebbers
On Feb 12, 3:41 am, a...@pythoncraft.com (Aahz) wrote: In article 34fcf680-1aa4-4835-9eba-3db3249f3...@q16g2000yqq.googlegroups.com, hjebbers  hjebb...@gmail.com wrote: the error is a windows thing, I can make a screenshot of it, but I can not copy/paste text. In that case, you need to

Re: Any way to turn off exception handling? (debugging)

2010-02-12 Thread Duncan Booth
Peter Otten __pete...@web.de wrote: You could try to shadow the exception class with None: ZeroDivisionError = None try: ... 1/0 ... except ZeroDivisionError: ... print caught ... Traceback (most recent call last): File stdin, line 2, in module ZeroDivisionError: integer

Re: Please help with MemoryError

2010-02-12 Thread Tim Chase
Aahz wrote: Tim Chase python.l...@tim.thechases.com wrote: Just to add to the mix, I'd put the anydbm module on the gradient between using a file and using sqlite. It's a nice intermediate step between rolling your own file formats for data on disk, and having to write SQL since access is

search entire drive say c:

2010-02-12 Thread prakash jp
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. Thanks in advance Regards Prakash -- http://mail.python.org/mailman/listinfo/python-list

Re: search entire drive say c:

2010-02-12 Thread Tim Chase
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. Well, you can just do it from DOS: c:\ dir /s/b/a abc.txt Just use os.walk() and check the list of files returned at each directory-level iteration. ROOT =

Re: python crash on windows but not on linux

2010-02-12 Thread Dave Angel
hjebbers wrote: On Feb 12, 3:41 am, a...@pythoncraft.com (Aahz) wrote: In article 34fcf680-1aa4-4835-9eba-3db3249f3...@q16g2000yqq.googlegroups.com, hjebbers hjebb...@gmail.com wrote: the error is a windows thing, I can make a screenshot of it, but I can not copy/paste text.

Re: search entire drive say c:

2010-02-12 Thread Simon Brunning
On 12 February 2010 12:17, prakash jp prakash.st...@gmail.com wrote: 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. http://code.activestate.com/recipes/499305/ might be a useful start. -- Cheers, Simon B. --

Re: python crash on windows but not on linux

2010-02-12 Thread Steve Holden
Dave Angel wrote: hjebbers wrote: On Feb 12, 3:41 am, a...@pythoncraft.com (Aahz) wrote: In article 34fcf680-1aa4-4835-9eba-3db3249f3...@q16g2000yqq.googlegroups.com, hjebbers hjebb...@gmail.com wrote: the error is a windows thing, I can make a screenshot of it, but I can not

Re: python crash on windows but not on linux

2010-02-12 Thread hjebbers
On Feb 12, 2:06 pm, Dave Angel da...@ieee.org wrote: hjebbers wrote: On Feb 12, 3:41 am, a...@pythoncraft.com (Aahz) wrote: In article 34fcf680-1aa4-4835-9eba-3db3249f3...@q16g2000yqq.googlegroups.com, hjebbers  hjebb...@gmail.com wrote: the error is a windows thing, I can make a

pyparsing wrong output

2010-02-12 Thread Eknath Venkataramani
I am trying to write a parser in pyparsing. Help Me. http://paste.pocoo.org/show/177078/ is the code and this is input file: http://paste.pocoo.org/show/177076/ . I get output as: generator object at 0xb723b80c * * -- Eknath Venkataramani +91-9844952442 --

Re: Any way to turn off exception handling? (debugging)

2010-02-12 Thread Peter Otten
Duncan Booth wrote: Peter Otten __pete...@web.de wrote: You could try to shadow the exception class with None: This works in Python 2.x but will break in Python 3. None is not a valid exception specification and Python 3 will check for that and complain. A better solution is to use an

Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Lloyd Zusman
Perl has the following constructs to check whether a file is considered to contain text or binary data: if (-T $filename) { print file contains 'text' characters\n; } if (-B $filename) { print file contains 'binary' characters\n; } Is there already a Python analog to these? I'm happy to write

Re: python crash on windows but not on linux

2010-02-12 Thread Christian Heimes
hjebbers wrote: The message on the screen is (I typed it over): ** python.exe python.exe has encountered a problem and needs to close. We are sorry for the inconvenience. If you were in the middle of

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Christian Heimes
Lloyd Zusman wrote: The -T and -B switches work as follows. The first block or so of the file is examined for odd characters such as strange control codes or characters with the high bit set. If too many strange characters (30%) are found, it's a -B file; otherwise it's a

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Chris Rebert
On Fri, Feb 12, 2010 at 6:01 AM, Lloyd Zusman l...@asfast.com wrote: Perl has the following constructs to check whether a file is considered to contain text or binary data: if (-T $filename) { print file contains 'text' characters\n; } if (-B $filename) { print file contains 'binary'

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Simon Brunning
On 12 February 2010 14:14, Christian Heimes li...@cheimes.de wrote: That's a butt ugly heuristic He did say it was from Perl, the home of butt-ugly. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list

Re: python crash on windows but not on linux

2010-02-12 Thread Peter Otten
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 DATA. Also your coding style is important. Can you provide more info? Yes, a

Re: Please help with MemoryError

2010-02-12 Thread Aahz
In article mailman.2426.1265976954.28905.python-l...@python.org, Tim Chase python.l...@tim.thechases.com wrote: Aahz wrote: Tim Chase python.l...@tim.thechases.com wrote: Just to add to the mix, I'd put the anydbm module on the gradient between using a file and using sqlite. It's a nice

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

2010-02-12 Thread Aahz
In article mailman.2422.1265961504.28905.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On 11 Feb 2010 21:18:26 -0800, a...@pythoncraft.com (Aahz) declaimed the following in gmane.comp.python.general: In article mailman.2077.1265524158.28905.python-l...@python.org,

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Aahz
In article mailman.2434.1265983307.28905.python-l...@python.org, Lloyd Zusman l...@asfast.com wrote: Perl has the following constructs to check whether a file is considered to contain text or binary data: if (-T $filename) { print file contains 'text' characters\n; } if (-B $filename) { print

Re: search entire drive say c:

2010-02-12 Thread prakash jp
Thank u Tim Case, all, Also how to run the standalone generated from script taking unc path names to account regards Prakash On Fri, Feb 12, 2010 at 6:31 PM, Tim Chase python.l...@tim.thechases.comwrote: can any of u help to search a file say abc.txt in entire c drive (windows) and print

Re: python crash on windows but not on linux

2010-02-12 Thread Bruno Desthuilliers
Peter Otten a écrit : (snip) Even on alt.haruspicy they cannot do much without a liver now and then... Muhahahahaha !-) +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Tim Chase
Lloyd Zusman wrote: Perl has the following constructs to check whether a file is considered to contain text or binary data: if (-T $filename) { print file contains 'text' characters\n; } if (-B $filename) { print file contains 'binary' characters\n; } Is there already a Python analog to these?

Re: Please help with MemoryError

2010-02-12 Thread Jeremy
On Feb 11, 6:50 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 11 Feb 2010 15:39:09 -0800, Jeremy wrote: My Python program now consumes over 2 GB of memory and then I get a MemoryError.  I know I am reading lots of files into memory, but not 2GB worth. Are you

Re: Please help with MemoryError

2010-02-12 Thread Tim Chase
Aahz wrote: Not quite. One critical difference between dbm and dicts is the need to remember to save changes by setting the key's valud again. Could you give an example of this? I'm not sure I understand what you're saying. Well, you're more likely to hit this by wrapping dbm with shelve

ANN: Leo 4.7 rc1 released

2010-02-12 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:

Re: ANN: obfuscate

2010-02-12 Thread Bob Martin
in 144460 20100212 103319 Jean-Michel Pichavant jeanmic...@sequans.com wrote: Bob Martin wrote: in 16 20100212 034121 Paul Rubin no.em...@nospam.invalid wrote: See http://en.wikipedia.org/wiki/Colossus_computer That was almost at the end of the war though. Colossus was working

Re: ANN: obfuscate

2010-02-12 Thread Mark Lawrence
Paul Rubin wrote: Mark Lawrence breamore...@yahoo.co.uk writes: The predecessor of the Enigma was cracked by Polish scientists years before WW2 started I believe that all of Enigma was eventually cracked cos of two major flaws. I think it never would have been cracked if it hadn't been

Re: Bizarre arithmetic results

2010-02-12 Thread Terry Reedy
On 2/12/2010 4:40 AM, Jussi Piitulainen wrote: Terry Reedy writes: On 2/11/2010 11:23 AM, Jussi Piitulainen wrote: Robert Kern writes: On 2010-02-11 06:31 AM, Shashwat Anand wrote: There is a little issue here that ' -.1 ** .1' should give you error message. That is it. No, fractional

concatenate fasta file

2010-02-12 Thread PeroMHC
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 sequences.. make them look like concatenated

Re: concatenate fasta file

2010-02-12 Thread Roy Smith
In article 62a50def-e391-4585-9a23-fb91f2e2e...@b9g2000pri.googlegroups.com, 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

Re: concatenate fasta file

2010-02-12 Thread Jean-Michel Pichavant
PeroMHC 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 sequences.. make

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread MRAB
Christian Heimes wrote: Lloyd Zusman wrote: The -T and -B switches work as follows. The first block or so of the file is examined for odd characters such as strange control codes or characters with the high bit set. If too many strange characters (30%) are found, it's a -B

Configuring apache to execute python scripts using mod_python handler

2010-02-12 Thread Juan Carlos Rodriguez
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added Directory D:/softwares/Apache2.2/htdocs AddHandler mod_python .py PythonHandler mptest PythonDebug On /Directory 2. Then I added the

Re: Re: python crash on windows but not on linux

2010-02-12 Thread Dave Angel
hjebbers wrote: On Feb 12, 2:06 pm, Dave Angel da...@ieee.org wrote: hjebbers wrote: On Feb 12, 3:41 am, a...@pythoncraft.com (Aahz) wrote: In article 34fcf680-1aa4-4835-9eba-3db3249f3...@q16g2000yqq.googlegroups.com, hjebbers hjebb...@gmail.com wrote: the

Re: Generic spreadsheet interface

2010-02-12 Thread Simon Hibbs
Hi Bro, I don't know of anything like that. The spreadsheet sites I do know of are application-specific. http://www.python-excel.org/ http://wiki.services.openoffice.org/wiki/Python http://lucasmanual.com/mywiki/OpenOffice Note that the OO.o bindings for Python are only for Python 2.3 which is

Re: Please help with MemoryError

2010-02-12 Thread Steven D'Aprano
On Fri, 12 Feb 2010 06:45:31 -0800, Jeremy wrote: You also confirmed what I thought was true that all variables are passed by reference so I don't need to worry about the data being copied (unless I do that explicitly). No, but yes. No, variables are not passed by reference, but yes, you

Re: looking for some libraries

2010-02-12 Thread Michael Torrie
rantingrick wrote: Well a GUI kit comes to mind. And since you did not mention a preference (or much really) i would suggest Tkinter in the stdlib as a starting point. Here is a big hint! I think the original poster is looking for a way to automate an existing GUI process, and screen-scrape

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Steven D'Aprano
On Fri, 12 Feb 2010 15:14:07 +0100, Christian Heimes wrote: Lloyd Zusman wrote: The -T and -B switches work as follows. The first block or so of the file is examined for odd characters such as strange control codes or characters with the high bit set. If too many strange

Re: python crash on windows but not on linux

2010-02-12 Thread hjebbers
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 DATA. Also your

Helpp I want view page .py on apache WHAT CAN I DO???????????????

2010-02-12 Thread Juan Carlos Rodriguez
Dear all, I am trying implement a text from mod_python. I have a apahce service 2.2.4, python 2.5 and mod_python 3.3.1 I have this mistake: MOD_PYTHON ERROR ProcessId: 5956 Interpreter:'192.168.5.32' ServerName: '192.168.5.32' DocumentRoot: 'D:/aplicaciones/web' URI:

Sorting a list of lists

2010-02-12 Thread R (Chandra) Chandrasekhar
Dear Folks, I have lines of values like so: 14, [25, 105, 104] 10, [107, 106, 162] 21, [26, 116, 165] I need to sort them in two ways: (a) By the numeric value of the first column; and (b) by the sum of the elements of the second item in each list, which is a list in itself. At present, I

Re: Bizarre arithmetic results

2010-02-12 Thread Jussi Piitulainen
Terry Reedy writes: On 2/12/2010 4:40 AM, Jussi Piitulainen wrote: Terry Reedy writes: On 2/11/2010 11:23 AM, Jussi Piitulainen wrote: Robert Kern writes: On 2010-02-11 06:31 AM, Shashwat Anand wrote: There is a little issue here that ' -.1 ** .1' should give you error message. That

Re: PExpect Cross-Platform Alternative

2010-02-12 Thread corey goldberg
I was just tasked to get these scripts running in a windows environment and to my dismay very quickly realized that pexpect is not cross platform compatible. Am I stuck, or are there solutions out there? I haven't tried it, but here is another Python implementation of Expect that claims

Re: Sorting a list of lists

2010-02-12 Thread MRAB
R (Chandra) Chandrasekhar wrote: Dear Folks, I have lines of values like so: 14, [25, 105, 104] 10, [107, 106, 162] 21, [26, 116, 165] I need to sort them in two ways: (a) By the numeric value of the first column; and (b) by the sum of the elements of the second item in each list, which is

Re: Sorting a list of lists

2010-02-12 Thread John Posner
On 2/12/2010 12:45 PM, R (Chandra) Chandrasekhar wrote: Dear Folks, I have lines of values like so: 14, [25, 105, 104] 10, [107, 106, 162] 21, [26, 116, 165] I need to sort them in two ways: (a) By the numeric value of the first column; and (b) by the sum of the elements of the second item

Re: Modifying Class Object

2010-02-12 Thread Michael Sparks
Hi Alf, Before I start, note we're talking about semantics, not implementation. That distinction is very important. On Feb 11, 4:49 am, Alf P. Steinbach al...@start.no wrote: *The* standard general language independent definition? [ of pointer ] Yes. As defined where? For example, as

Re: Please help with MemoryError

2010-02-12 Thread John Posner
On 2/12/2010 12:14 PM, Steven D'Aprano wrote: On Fri, 12 Feb 2010 06:45:31 -0800, Jeremy wrote: You also confirmed what I thought was true that all variables are passed by reference so I don't need to worry about the data being copied (unless I do that explicitly). No, but yes. No,

Re: Pixel control

2010-02-12 Thread joao abrantes
noone knows if it's possible? i really need this.. On Thu, Feb 4, 2010 at 10:57 PM, joao abrantes senhor.abran...@gmail.comwrote: Hello everyone. For example i am using a screen resolution of 800x600 is it possible to make python control the color of the pixels? For example paint the pixel

Re: Replace various regex

2010-02-12 Thread McColgst
On Feb 12, 2:39 pm, Martin mdeka...@gmail.com wrote: 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

Re: Please help with MemoryError

2010-02-12 Thread mk
John Posner wrote: http://effbot.org/zone/call-by-object.htm http://en.wikipedia.org/wiki/Evaluation_strategy [1] http://mail.python.org/pipermail/edu-sig/2008-May/008583.html Hmm how about call by label-value? That is, you change labels by assignment, but pass the value of the

Re: Modifying Class Object

2010-02-12 Thread Alf P. Steinbach
* Michael Sparks: Hi Alf, Before I start, note we're talking about semantics, not implementation. That distinction is very important. Yes. It would seem to readers that posters here do not grasp and are unable to grasp that distinction. However, all those references to implementation

Re: Please help with MemoryError

2010-02-12 Thread Mel
mk wrote: John Posner wrote: http://effbot.org/zone/call-by-object.htm http://en.wikipedia.org/wiki/Evaluation_strategy [1] http://mail.python.org/pipermail/edu-sig/2008-May/008583.html Hmm how about call by label-value? Nothing egregiously wrong with it.. maybe it's a bit

Re: Replace various regex

2010-02-12 Thread Martin
On Feb 12, 7:57 pm, McColgst mccol...@gmail.com wrote: On Feb 12, 2:39 pm, Martin mdeka...@gmail.com wrote: 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   !  

Re: Replace various regex

2010-02-12 Thread MRAB
McColgst wrote: On Feb 12, 2:39 pm, Martin mdeka...@gmail.com wrote: 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)

Re: A silly question on file opening

2010-02-12 Thread joy99
On Feb 11, 1:57 am, Anthony Tolle anthony.to...@gmail.com wrote: On Feb 10, 3:42 pm,joy99subhakolkata1...@gmail.com wrote: Dear Group, [snip] I tried to change the location to D:\file and as I saw in Python Docs the file reading option is now r+ so I changed the statement to    

Re: Python version of perl's if (-T ..) and if (-B ...)?

2010-02-12 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: In article mailman.2434.1265983307.28905.python-l...@python.org, Lloyd Zusman l...@asfast.com wrote: if (-T $filename) { print file contains 'text' characters\n; } if (-B $filename) { print file contains 'binary' characters\n; } Assuming you're on a

ImportError: No module named mptest

2010-02-12 Thread Juan Carlos Rodriguez
Dear all, I am trying implement a text from mod_python. I have a apahce service 2.2.4, python 2.5 and mod_python 3.3.1 I have this mistake: MOD_PYTHON ERROR ProcessId: 5956 Interpreter:'192.168.5.32' ServerName: '192.168.5.32' DocumentRoot: 'D:/aplicaciones/web' URI:

Re: Please help with MemoryError

2010-02-12 Thread Christian Heimes
mk wrote: Hmm how about call by label-value? Or call by guido? How do you like call like a dutch? :] -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with MemoryError

2010-02-12 Thread Alf P. Steinbach
* Christian Heimes: mk wrote: Hmm how about call by label-value? Or call by guido? How do you like call like a dutch? :] Just a note: it might be more clear to talk about pass by XXX than call by XXX. Unless you're talking about something else than argument passing. The standard

Re: Replace various regex

2010-02-12 Thread Martin
On Feb 12, 8:30 pm, MRAB pyt...@mrabarnett.plus.com wrote: McColgst wrote: On Feb 12, 2:39 pm, Martin mdeka...@gmail.com wrote: 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  

Re: Please help with MemoryError

2010-02-12 Thread Ethan Furman
mk wrote: John Posner wrote: http://effbot.org/zone/call-by-object.htm http://en.wikipedia.org/wiki/Evaluation_strategy [1] http://mail.python.org/pipermail/edu-sig/2008-May/008583.html Hmm how about call by label-value? That is, you change labels by assignment, but pass the

Re: Please help with MemoryError

2010-02-12 Thread Steven D'Aprano
On Fri, 12 Feb 2010 21:07:08 +0100, mk wrote: John Posner wrote: http://effbot.org/zone/call-by-object.htm http://en.wikipedia.org/wiki/Evaluation_strategy [1] http://mail.python.org/pipermail/edu-sig/2008-May/008583.html Hmm how about call by label-value? Python's calling

Re: Please help with MemoryError

2010-02-12 Thread Antoine Pitrou
Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : What Python does is called pass by sharing, or sometimes pass by object reference. It is exactly the same as what (e.g.) Ruby and Java do, except that confusingly the Ruby people call it pass by reference and the Java people call

Re: Please help with MemoryError

2010-02-12 Thread Steve Holden
Antoine Pitrou wrote: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : What Python does is called pass by sharing, or sometimes pass by object reference. It is exactly the same as what (e.g.) Ruby and Java do, except that confusingly the Ruby people call it pass by reference and

Re: Please help with MemoryError

2010-02-12 Thread Alf P. Steinbach
* Antoine Pitrou: Le Fri, 12 Feb 2010 17:14:57 +, Steven D'Aprano a écrit : What Python does is called pass by sharing, or sometimes pass by object reference. It is exactly the same as what (e.g.) Ruby and Java do, except that confusingly the Ruby people call it pass by reference and the

Re: Modifying Class Object

2010-02-12 Thread Steve Holden
Alf P. Steinbach wrote: You may note that that Wikipedia article refers to an article that I wrote about pointers in C++. It's a broken link, referring to a non-existent server. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon is coming! Atlanta, Feb 2010

Re: Please help with MemoryError

2010-02-12 Thread Antoine Pitrou
Le Fri, 12 Feb 2010 17:10:01 -0500, Steve Holden a écrit : As has already been pointed out, if Python used call by reference then the following code would run without raising an AssertionError: def exchange(a, b): a, b = b, a x = 1 y = 2 exchange(x, y) assert (x == 2 and y == 1)

Re: Modifying Class Object

2010-02-12 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: You may note that that Wikipedia article refers to an article that I wrote about pointers in C++. It's a broken link, referring to a non-existent server. Yes, sorry. It's been that way a long time, and for the same reason my C++ tutorial, the only

Re: Please help with MemoryError

2010-02-12 Thread Antoine Pitrou
Le Fri, 12 Feb 2010 23:12:06 +0100, Alf P. Steinbach a écrit : Steven talks about the standard meaning of pass by reference. See my answer to Steve's message. You can't postulate a standard meaning of pass by reference independently of the specificities of each language. For example a

Re: python crash on windows but not on linux

2010-02-12 Thread Rob Williscroft
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: # http://msdn.microsoft.com/en-us/library/ms680621(VS.85).aspx SEM_FAILCRITICALERRORS = 1 SEM_NOALIGNMENTFAULTEXCEPT

Re: Please help with MemoryError

2010-02-12 Thread Alf P. Steinbach
* Antoine Pitrou: Le Fri, 12 Feb 2010 23:12:06 +0100, Alf P. Steinbach a écrit : Steven talks about the standard meaning of pass by reference. See my answer to Steve's message. You can't postulate a standard meaning of pass by reference independently of the specificities of each language.

Re: Please help with MemoryError

2010-02-12 Thread Gib Bogle
Steven D'Aprano wrote: def swap(a, b): a, b = b, a x = 1 y = 2 swap(x, y) assert (x == 2) and (y==1) Can't the same point be more simply made with this example: def setval(a): a = 12345 x = 1 setval(x) print x ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with MemoryError

2010-02-12 Thread Steve Holden
Gib Bogle wrote: Steven D'Aprano wrote: def swap(a, b): a, b = b, a x = 1 y = 2 swap(x, y) assert (x == 2) and (y==1) Can't the same point be more simply made with this example: def setval(a): a = 12345 x = 1 setval(x) print x Yes, and it will doubtless be subject

Re: Please help with MemoryError

2010-02-12 Thread Antoine Pitrou
Le Fri, 12 Feb 2010 23:49:38 +0100, Alf P. Steinbach a écrit : The main reason for not using that term for Python is that pass by reference has the extremely strong connotation of being able to implement 'swap'. But 'swap' is so easy to write as a one-line statement that it's foolish to

Re: Please help with MemoryError

2010-02-12 Thread Gregory Ewing
Steven D'Aprano wrote: Python's calling convention already has an well-established name, established over thirty years ago by the distinguished computer scientist Barbara Liskov, namely call-by-sharing. And she was mistaken in thinking it needed a new name. -- Greg --

Re: Modifying Class Object

2010-02-12 Thread Alf P. Steinbach
* 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

Re: intolerant HTML parser

2010-02-12 Thread Jim
I want to thank everyone for the help, which I found very useful (the parts that I understood :-) ). Since I think there was some question, it happens that I am working under django and submitting a certain form triggers an html mail. I wanted to validate the html in some of my unit tests. It

Re: Configuring apache to execute python scripts using mod_python handler

2010-02-12 Thread Kev Dwyer
On Fri, 12 Feb 2010 13:08:59 -0400, Juan Carlos Rodriguez wrote: Hello Juan Carlos, You're better off raising this on the mod_python list, however... Python is looking for a module called mptest, and cannot find it. Have you created the mptest.py module? (It should contain the handler function

Re: Please help with MemoryError

2010-02-12 Thread Robert Kern
On 2010-02-12 17:30 PM, Antoine Pitrou wrote: Le Fri, 12 Feb 2010 23:49:38 +0100, Alf P. Steinbach a écrit : The main reason for not using that term for Python is that pass by reference has the extremely strong connotation of being able to implement 'swap'. But 'swap' is so easy to write as

MemoryError, can I use more?

2010-02-12 Thread Echavarria Gregory, Maria Angelica
Dear group: I am developing a program using Python 2.5.4 in windows 32 OS. The amount of data it works with is huge. I have managed to keep memory footprint low, but have found that, independent of the physical RAM of the machine, python always gives the MemoryError message when it has

Re: Dreaming of new generation IDE

2010-02-12 Thread Aahz
In article mailman.2085.1265546107.28905.python-l...@python.org, Steve Holden st...@holdenweb.com wrote: bartc wrote: Arnaud Delobelle arno...@googlemail.com wrote in message news:m28wb6ypfs@googlemail.com... Gabriel Genellina gagsl-...@yahoo.com.ar writes: Note the *literal* part. If

Re: pyparsing wrong output

2010-02-12 Thread Gabriel Genellina
En Fri, 12 Feb 2010 10:41:40 -0300, Eknath Venkataramani eknath.i...@gmail.com escribió: I am trying to write a parser in pyparsing. Help Me. http://paste.pocoo.org/show/177078/ is the code and this is input file: http://paste.pocoo.org/show/177076/ . I get output as: generator object at

Re: MemoryError, can I use more?

2010-02-12 Thread Chris Kaynor
A 32 bit app can only use 4 GB of memory itself (regardless of the amount of system ram), the OS claims some of this for the system, dlls occupy some of it, etc. As such, the app can only really use a smaller subset (generally between 2 to 3 GB, depending upon the app and the OS). Chris On Fri,

  1   2   >