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 po

Re: ANN: obfuscate

2010-02-12 Thread Tim Golden
On 11/02/2010 11:32, Paul Rubin wrote: Gregory Ewing 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 forces that used their Enigmas

Re: python crash on windows but not on linux

2010-02-12 Thread hjebbers
On Feb 11, 5:45 pm, M3RT 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 possible that

Re: ANN: obfuscate

2010-02-12 Thread Bob Martin
in 16 20100212 034121 Paul Rubin 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://mail.python.org/mailman/li

Re: python crash on windows but not on linux

2010-02-12 Thread Peter Otten
hjebbers wrote: > On Feb 11, 5:45 pm, M3RT 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 wondering if

Re: ANN: obfuscate

2010-02-12 Thread Paul Rubin
Mark Lawrence 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 the Brits or the P

Re: Modifying Class Object

2010-02-12 Thread Martin P. Hellwig
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 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 a = -0.1; b

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 numb

Re: ANN: obfuscate

2010-02-12 Thread Jean-Michel Pichavant
Bob Martin wrote: in 16 20100212 034121 Paul Rubin 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 ;-) sept 1939

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

2010-02-12 Thread Vinay Sajip
On Feb 11, 7:12 pm, mk 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_socke

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   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 -- very

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 "", line 2, in > ZeroDivisionError:

Re: Please help with MemoryError

2010-02-12 Thread Tim Chase
Aahz wrote: Tim Chase 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 entirely like you'd do with

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 wrote: the error is a windows thing, I can make a screenshot of it, but I can not copy/paste text. In that case, yo

Re: search entire drive say c:

2010-02-12 Thread Simon Brunning
On 12 February 2010 12:17, prakash jp 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. -- http://mail.python.org/

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 wrote: >>> >>> the error is a windows thing, I can make a screenshot of it, but I ca

Re: python crash on windows but not on linux

2010-02-12 Thread hjebbers
On Feb 12, 2:06 pm, 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   wrote: > > >>> the error is a windows thing, I can make a screenshot of

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: * * -- Eknath Venkataramani +91-9844952442 -- http://mail.python.org/mailman/listinfo/python-list

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 u

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 w

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 midd

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

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 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

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 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 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 , Tim Chase wrote: >Aahz wrote: >> Tim Chase 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

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

2010-02-12 Thread Aahz
In article , Dennis Lee Bieber wrote: >On 11 Feb 2010 21:18:26 -0800, a...@pythoncraft.com (Aahz) declaimed the >following in gmane.comp.python.general: >> In article , >> Gabriel Genellina wrote: >>> >>>Strange. With Python 2.6.4 I don't need to do that; I'd say the difference >>>is in the OS

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

2010-02-12 Thread Aahz
In article , 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"; } Assuming you're

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 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

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

Re: Please help with MemoryError

2010-02-12 Thread Jeremy
On Feb 11, 6:50 pm, Steven D'Aprano 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 sure? > > Keep in mind that Pyt

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=3458&package_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: http://webpages.charter.net/e

Re: ANN: obfuscate

2010-02-12 Thread Bob Martin
in 144460 20100212 103319 Jean-Michel Pichavant wrote: >Bob Martin wrote: >> in 16 20100212 034121 Paul Rubin wrote: >> >> >>> See http://en.wikipedia.org/wiki/Colossus_computer >>> That was almost at the end of the war though. >>> >>

Re: ANN: obfuscate

2010-02-12 Thread Mark Lawrence
Paul Rubin wrote: Mark Lawrence 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 the B

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 tactcatacatacacg

Re: concatenate fasta file

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

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 th

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 AddHandler mod_python .py PythonHandler mptest PythonDebug On 2. Then I added the line "LoadModule python_module modules/ mod_python.s

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 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 wrote: the error is a windows thing, I can

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 strang

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 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 yo

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

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 i

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" wrote: > > *The* standard general language independent definition? [ of pointer ] > Yes. > > > As defined where? > > For example, as I use

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, variabl

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 wrote: > 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 (100,200) in red! And it

Re: Replace various regex

2010-02-12 Thread McColgst
On Feb 12, 2:39 pm, Martin 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 the pattern

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 aspe

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.. mayb

Re: Replace various regex

2010-02-12 Thread Martin
On Feb 12, 7:57 pm, McColgst wrote: > On Feb 12, 2:39 pm, Martin 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,

Re: Replace various regex

2010-02-12 Thread MRAB
McColgst wrote: On Feb 12, 2:39 pm, Martin 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 the pat

Re: A silly question on file opening

2010-02-12 Thread joy99
On Feb 11, 1:57 am, Anthony Tolle wrote: > On Feb 10, 3:42 pm,joy99 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 > >    file_open=open("D:\file","r+") > > but it i

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

2010-02-12 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: > In article , > Lloyd Zusman wrote: > >if (-T $filename) { print "file contains 'text' characters\n"; } > >if (-B $filename) { print "file contains 'binary' characters\n"; } > > Assuming you're on a Unix-like system or can install Cygwin, the > standard respo

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 wrote: > McColgst wrote: > > On Feb 12, 2:39 pm, Martin 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

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 v

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"? Pyth

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 pe

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 refe

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 t

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 h

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 an

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 on

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 langua

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 wi

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 t

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 -- http://mail.python.org/

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 lyin

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 is

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 occupied

Re: Dreaming of new generation IDE

2010-02-12 Thread Aahz
In article , Steve Holden wrote: >bartc wrote: >> "Arnaud Delobelle" wrote in message >> news:m28wb6ypfs@googlemail.com... >>> "Gabriel Genellina" writes: Note the *literal* part. If you (the programmer) is likely to know the parameter value when writing the code, then the f

Re: pyparsing wrong output

2010-02-12 Thread Gabriel Genellina
En Fri, 12 Feb 2010 10:41:40 -0300, Eknath Venkataramani 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: There is nothing wrong with pyparsing he

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,

Re: Modifying Class Object

2010-02-12 Thread Steve Holden
Alf P. Steinbach wrote: [...] > Of course most anyone else who'd hold the > rational opinion would not join the battlefield, because it clearly > wasn't and isn't about convincing or educating anyone, but I feel that > follow-ups to my articles should be answered. > In other words, you must have t

Re: Modifying Class Object

2010-02-12 Thread Mark Lawrence
Alf P. Steinbach wrote: * 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 someb

Re: Please help with MemoryError

2010-02-12 Thread Gregory Ewing
Antoine Pitrou wrote: It's just that assignment ("=") means a different thing in Python than in non-object languages (or fake-object languages such as C++ or PHP): it rebinds instead of mutating in-place. If it mutated, you wouldn't have the AssertionError. It doesn't really have anything t

Re: MemoryError, can I use more?

2010-02-12 Thread sstein...@gmail.com
On Feb 12, 2010, at 7:21 PM, Echavarria Gregory, Maria Angelica wrote: > 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 RA

  1   2   >