Re: How do you implement a Progress Bar

2010-02-12 Thread Alf P. Steinbach
* J Wolfe: 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. Thanks, Jonathan ##file Meter.py fro

How do you implement a Progress Bar

2010-02-12 Thread J Wolfe
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. Thanks, Jonathan ##file Meter.py from Tkinter imp

Re: MemoryError, can I use more?

2010-02-12 Thread Nobody
On Fri, 12 Feb 2010 19:21:22 -0500, Echavarria Gregory, Maria Angelica wrote: > 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 mach

Re: Executing Commands From Windows Service

2010-02-12 Thread T
On Feb 11, 8:21 am, "Martin P. Hellwig" wrote: > On 02/07/10 19:02, T wrote: > > > I have a script, which runs as a Windows service under the LocalSystem > > account, that I wish to have execute some commands.  Specifically, the > > program will call plink.exe to create a reverse SSH tunnel.  Righ

Re: Executing Commands From Windows Service

2010-02-12 Thread T
On Feb 11, 4:10 am, Tim Golden wrote: > On 10/02/2010 22:55, T wrote: > > > Great suggestions once again - I did verify that it was at least > > running the plink.exe binary when under LocalSystem by having the > > service run "plink.exe>  C:\plinkoutput.txt" - this worked fine.  And, > > as I men

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-12 Thread John Nagle
kj wrote: Some people have mathphobia. I'm developing a wicked case of Unicodephobia. I have read a *ton* of stuff on Unicode. It doesn't even seem all that hard. Or so I think. Then I start writing code, and WHAM: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordi

Re: pyparsing wrong output

2010-02-12 Thread Paul McGuire
On Feb 12, 6:41 pm, "Gabriel Genellina" wrote: > 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/

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-12 Thread John Nagle
kj wrote: =A0 x =3D '%s' % y =A0 x =3D '%s' % z =A0 print y =A0 print z =A0 print y, z Bear in mind that most Python implementations assume the "console" only handles ASCII. So "print" output is converted to ASCII, which can fail. (Actually, all modern Windows and Linux systems support Un

Re: fork vs threading.Thread

2010-02-12 Thread Alf P. Steinbach
* Jordan Apgar: I'm trying to run two servers in the same program at once. Here are the two: class TftpServJ(Thread): def __init__(self, ip, root, port=69, debug = False ): Thread.__init__(self) setup stuff here def run(self): try: self.server.listen(

Re: fork vs threading.Thread

2010-02-12 Thread Chris Colbert
dont call the .run() method, call the .start() method which is defined the Thread class (and should NOT be overridden). tftpserv.start() xmlserv.start() On Fri, Feb 12, 2010 at 10:57 PM, Jordan Apgar wrote: > I'm trying to run two servers in the same program at once. Here are > the two: > cl

fork vs threading.Thread

2010-02-12 Thread Jordan Apgar
I'm trying to run two servers in the same program at once. Here are the two: class TftpServJ(Thread): def __init__(self, ip, root, port=69, debug = False ): Thread.__init__(self) setup stuff here def run(self): try: self.server.listen(self.ip, self.port

Re: Modifying Class Object

2010-02-12 Thread rantingrick
This entire thread has imploded like a neutron star into an infantile debate that only Caddie Couric, Bill O Reilly, and everyone on PMS-NBC can hold a candle to! The only post i enjoyed was Steve Howes! >From my unique perspective of not really knowing (or for that matter) really caring about any

Re: ConfigParser is not parsing

2010-02-12 Thread Rolando Espinoza La Fuente
read() does not return the config object >>> import ConfigParser >>> config = ConfigParser.SafeConfigParser() >>> config.read('S3Files.conf') ['S3Files.conf'] >>> config.sections() ['main'] >>> config.get('main', 'taskName') 'FileConfigDriver' Regards, Rolando Espinoza La fuente www.rolandoespin

ConfigParser is not parsing

2010-02-12 Thread felix gao
Hi all, I am trying to get the some configuration file read in by Python, however, after the read command it return a list with the filename that I passed in. what is going on? Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright",

Re: Pixel control

2010-02-12 Thread Gabriel Genellina
En Fri, 12 Feb 2010 16:12:37 -0300, joao abrantes escribió: 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

Re: Function attributes

2010-02-12 Thread Gabriel Genellina
En Fri, 12 Feb 2010 04:29:12 -0300, Arnaud Delobelle 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 see your post, nor several other earlier posts i

Re: MemoryError, can I use more?

2010-02-12 Thread Christian Heimes
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 RAM of the machine, python > alw

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

2010-02-12 Thread Gabriel Genellina
En Fri, 12 Feb 2010 11:22:40 -0300, Aahz escribió: 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 th

Re: Calendar GUI

2010-02-12 Thread Aahz
In article , wrote: > >Take a look at wxscheduler, and chandler. You're joking about Chandler, right? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "At Resolver we've found it useful to short-circuit any doubt and just refer to comments in code as '

Re: Modifying Class Object

2010-02-12 Thread Alf P. Steinbach
* Mark Lawrence: Alf P. Steinbach wrote: An extremely long thread dedicated to the notion that there are no references in Python (which is blatantly false), coupled with personal attacks on the one person arguing that there are. I could easily think that you were having me on. Of course most

Re: MemoryError, can I use more?

2010-02-12 Thread Benjamin Kaplan
On Fri, 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

Re: Dreaming of new generation IDE

2010-02-12 Thread Aahz
In article <4b743340$0$20738$426a7...@news.free.fr>, Bruno Desthuilliers wrote: > >Ever read "worst is better" ?-) Nope -- maybe you mean "worse is better"? http://www.jwz.org/doc/worse-is-better.html (Nitpicking because you need the correct term to search.) -- Aahz (a...@pythoncraft.com)

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

2010-02-12 Thread Gabriel Genellina
Hola! En Fri, 12 Feb 2010 14:34:33 -0300, Juan Carlos Rodriguez escribió: ImportError: No module named mptest Hay una lista en castellano sobre Python: http://python.org.ar/pyar/ListaDeCorreo -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: MemoryError, can I use more?

2010-02-12 Thread Mark Lawrence
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 RAM of the machine, python always gives

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

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

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

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

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

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

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

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:

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

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

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

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

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

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

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

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

  1   2   >