Re: function object.func_default off the console

2007-04-25 Thread Peter Otten
Aaron Brady wrote: f.func_defaults[0] > [2, 3] f.func_defaults[0]+=[4] > Traceback (most recent call last): >File "", line 1, in > TypeError: 'tuple' object does not support item assignment f.func_defaults[0] > [2, 3, 4] > > V. interesting. Operation succeeds but with a throw

trinary operator - if then else

2007-04-25 Thread Alchemist
What is Python's version for the trinary if..then..else operator? I want a one-liner such as a?b:c for the if..then..else control structure if a then b else c Does Python 2.4 support it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching a specific IO error

2007-04-25 Thread Tina I
Gabriel Genellina wrote: > You can get the 2 as the errno exception attribute. BTW, 2 == errno.ENOENT > > try: > export = open(self.exportFileName , 'w') > except IOError, e: > if e.errno==errno.ENOENT: > # handle the "No such file or directory" error >

Re: trinary operator - if then else

2007-04-25 Thread Peter Otten
Alchemist wrote: > What is Python's version for the trinary if..then..else operator? true_value if condition else false_value > Does Python 2.4 support it? No, it requires 2.5 or later. Peter -- http://mail.python.org/mailman/listinfo/python-list

RE: If Dict Contains a particular key

2007-04-25 Thread Robert Rawlins - Think Blue
Thanks guys for this, glad it was so simple. I used mikes solution in the end, and it worked a charm. Thanks again, Rob From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Bentley Sent: 24 April 2007 18:37 To: [email protected] Subject: Re: If Dict Contains a

Re: Tutorial creates confusion about slices

2007-04-25 Thread Antoon Pardon
On 2007-04-24, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Really only one person has argued that the docs do not need to be > changed. The other two people seemed to think you were asking for help > rather than discussing how to revise the docs. Understandable, since > that's why most people

Re: Python un-plugging the Interpreter

2007-04-25 Thread Hendrik van Rooyen
"Jorgen Grahn" <[EMAIL PROTECTED]> wrote: > On Thu, 19 Apr 2007 20:39:57 -0700, Alex Martelli <[EMAIL PROTECTED]> wrote: > > Steve Holden <[EMAIL PROTECTED]> wrote: > > > >> A long time ago Greg Stein produced a patch that removed the need for > >> the GIL, but nobody seemed to want to pay the pen

Re: Tutorial creates confusion about slices

2007-04-25 Thread Antoon Pardon
On 2007-04-24, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: >> On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> wrote: >> > >> > On Apr 24, 2007, at 6:35 AM, Antoon Pardon wrote: >> > >> >> People don't read tutorials in a strictly linear fashion. They can >> >> continue

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Jeff Rush wrote: > > There is discussion by the Python Software Foundation of offering cash > > bounties or perhaps periodic awards to the "best of" for magazine articles, > > video/screencast clips and such. > > > > If YOU would be swayed to get invol

If Dict Contains...

2007-04-25 Thread Robert Rawlins - Think Blue
Hello Guys, Looking to build a quick if/else statement that checks a dictionary for a key like follows. If myDict contains ThisKey: Do this... Else Do that... Thats the best way of doing this? Thanks, Rob -- http://mail.python.org/mailman/lis

Charlotte Python Group

2007-04-25 Thread Calvin Spealman
Attending my first meetup tomorrow for the Agile Charlotte group from meetup.com. My old area, surrounded by cows and corn, had no chance of getting any meetups, so I'm excited to be back at the city and able to partake in some community. If anyone by chance is attending, or near enough to make it,

Re: *** Watch BOMBSHELL video of Senator John Kerry admitting 911 was in INSIDE JOB ???

2007-04-25 Thread joseph2k
Jon Slaughter wrote: > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> http://www.911blogger.com/node/8053 >> >> Senator John Kerry was questioned concerning 9/11 during an appearance >> at Book People in Austin, Texas. Members of Austin 9/11 Truth Now >> asked Kerry about the

Re: MS SQL Server Extension?

2007-04-25 Thread Tim Golden
Jack wrote: > Hi all, in my next project, my Python code needs to talk to an MS SQL > 2000 Server. Internet search gives me http://pymssql.sourceforge.net/ > I wonder what module(s) people are using. My code runs on a Linux > box so the module has to build on Linux. Any hints/pointers are welcome.

Re: Tutorial creates confusion about slices

2007-04-25 Thread Ant
Hi Antoon, > The best way to remember how slices work is to think of the indices as ... > +---+---+---+---+---+ > | H | e | l | p | A | > +---+---+---+---+---+ > 0 1 2 3 4 5 > -5 -4 -3 -2 -1 > > This is all very well with a simple slice like: > > "HelpA"[2:4]=> "lp

popen2 results

2007-04-25 Thread Robert Rawlins - Think Blue
Hello guys, I've recently ported my application from bash to python, however there are still a few bash line utilities I -have- to use in the application as there isn't any alternative available to me. In the old days of bash I would have grep'd the output from these commands to determine the o

Re: Tutorial creates confusion about slices

2007-04-25 Thread Tim Golden
Antoon Pardon wrote: > On 2007-04-24, Michael Hoffman <[EMAIL PROTECTED]> wrote: > >> Really only one person has argued that the docs do not need to be >> changed. The other two people seemed to think you were asking for help >> rather than discussing how to revise the docs. Understandable, sinc

Coding conventions for class names

2007-04-25 Thread Kay Schluehr
set, int, float, list, object,... Don't see any of the basic types following the capitalized word convention for classes covered by PEP 08. This does not hold only for __builtins__ in the strict sense but also for types defined in builtin modules like datetime. My question is: does anyone actuall

Re: If Dict Contains...

2007-04-25 Thread Daniel Nogradi
> Looking to build a quick if/else statement that checks a dictionary for a > key like follows. > > If myDict contains ThisKey: > > Do this... > > Else > > Do that... > > > > Thats the best way of doing this? if key in myDict: Do this. else: Do that

How to change font colour

2007-04-25 Thread [EMAIL PROTECTED]
I use PIL to write some text to a picture.The text must  be seen wery clearly. I write the text to different pictures but to the same position. As  pictures maybe  different, colour, in the position where I write the text, is also different. Is there a way how to set the font colour so that it

Re: Tutorial creates confusion about slices

2007-04-25 Thread Ant
On Apr 23, 1:38 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > The following is part of the explanation on slices in the > tutorial: > > The best way to remember how slices work is to think of the indices as ... > +---+---+---+---+---+ > | H | e | l | p | A | > +---+---+---+---+---+ > 0 1

Re: Coding conventions for class names

2007-04-25 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Kay Schluehr wrote: > set, int, float, list, object,... > > Don't see any of the basic types following the capitalized word > convention for classes covered by PEP 08. This does not hold only for > __builtins__ in the strict sense but also for types defined in builtin > mo

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Antoon Pardon
On 2007-04-24, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: >>> When cash is involved, it's important to avoid even the slightest >>> hint of a suggestion of a suspicion of a conflict of interest; >>> that, I guess, is why firms that run contests with cash prizes >>> always dec

Re: Coding conventions for class names

2007-04-25 Thread Michael Hoffman
Kay Schluehr wrote: > My question is: does anyone actually follow guidelines here Yes. > and if yes > which ones and are they resonable ( e.g. stable with regard to > refactoring etc. )? All of them that I know of. What does it mean to be "stable with regard to refactoring etc."? -- Michael H

Re: q: how to output a unicode string?

2007-04-25 Thread Frank Stajano
Diez B. Roggisch wrote: > Frank Stajano wrote: > >> A simple unicode question. How do I print? >> >> Sample code: >> >> # -*- coding: utf-8 -*- >> s1 = u"héllô wórld" >> print s1 >> # Gives UnicodeEncodeError: 'ascii' codec can't encode character >> # u'\xe9' in position 1: ordinal not in range(12

Re: q: how to output a unicode string?

2007-04-25 Thread Diez B. Roggisch
> So why is it that in the first case I got UnicodeEncodeError: 'ascii' > codec can't encode? Seems as if, within Idle, a utf-8 codec is being > selected automagically... why should that be so there and not in the > first case? I'm a bit confused on what you did when the error appears if you t

Re: Tutorial creates confusion about slices

2007-04-25 Thread Antoon Pardon
On 2007-04-25, Ant <[EMAIL PROTECTED]> wrote: > On Apr 23, 1:38 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> The following is part of the explanation on slices in the >> tutorial: >> >> The best way to remember how slices work is to think of the indices as > ... >> +---+---+---+---+---+ >> |

Now()

2007-04-25 Thread Robert Rawlins - Think Blue
Hello Guys, I'm using the following function 'str (now)' to place a date time stamp into a log file, which works fine, however it writes the stamp like this. 2007-04-25 11:06:53.873029 But I need to expel those extra decimal places as they're causing problems with the application that p

Re: trinary operator - if then else

2007-04-25 Thread Michael Bentley
On Apr 25, 2007, at 1:58 AM, Alchemist wrote: > What is Python's version for the trinary if..then..else operator? > > I want a one-liner such as > a?b:c > for the if..then..else control structure > if a > then b > else c > > Does Python 2.4 support it? Not precisely, but you can *usually*

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Anton Vredegoor
Antoon Pardon wrote: >>> That's a good point, and also a valid reason for restricting the >>> voting community to PSF members. Thanks, Alex. >> So in order to avoid a suspicion of a conflict of interest you want to >> turn the whole thing into private property of the PSF? >> >> That is the most

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Anton Vredegoor
Anton Vredegoor wrote: > It's about as ridiculous as proving that a stiff parrot is dead by > grabbing it by the legs and repeatedly hitting it's head on the counter. Or to write "it's" where its is more appropriate. A. -- http://mail.python.org/mailman/listinfo/python-list

PIL font formatting...

2007-04-25 Thread Durumdara
Hi! I wrote a web visitor counter with modpy and pil. It is must working on half-static page, so I must write this counter with jpeg image output. Everything is working good, but I need to change this counter a little, it's style isn't same as it's webpage's style. I want to make bold and itali

Re: Coding conventions for class names

2007-04-25 Thread Michael Hoffman
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Kay Schluehr > wrote: > >> set, int, float, list, object,... >> >> Don't see any of the basic types following the capitalized word >> convention for classes covered by PEP 08. This does not hold only for >> __builtins__ in the strict sense

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Antoon Pardon
On 2007-04-25, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > That's a good point, and also a valid reason for restricting the voting community to PSF members. Thanks, Alex. >>> So in order to avoid a suspicion of a conflict of interest you want to >>> turn the whole

Re: trinary operator - if then else

2007-04-25 Thread Diez B. Roggisch
Michael >> >> Does Python 2.4 support it? > > Not precisely, but you can *usually* get away with: > > a and b or c This is really bad advice, as long as you don't explain why it "usually" works (and often enough not). This for example won't work: >>> False or '' and 0 '' The reason is that the

jython: user-defined modules

2007-04-25 Thread Gregor Stich
Dear all, I hope my question is here in the right place... What I want to achieve is a communication between Java and Python. We have a pretty strong framework of existing python scripts and modules. Now I want to use jython in order to faciliate the communication between another Java framework.

Re: Now()

2007-04-25 Thread Daniel Nogradi
> I'm using the following function 'str (now)' to place a date time stamp into > a log file, which works fine, however it writes the stamp like this. > > 2007-04-25 11:06:53.873029 > > But I need to expel those extra decimal places as they're causing problems > with the application that parses the

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Anton Vredegoor
Antoon Pardon wrote: > On 2007-04-25, Anton Vredegoor <[EMAIL PROTECTED]> wrote: >> Antoon Pardon wrote: >> > That's a good point, and also a valid reason for restricting the > voting community to PSF members. Thanks, Alex. So in order to avoid a suspicion of a conflict of interest you

Re: Now()

2007-04-25 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm using the following function 'str (now)' to place a date time stamp into > a log file, which works fine, however it writes the stamp like this. > 2007-04-25 11:06:53.873029 > But I need to expel those extra decimal places as they're causing problems > wit

RE: Tutorial creates confusion about slices

2007-04-25 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Antoon Pardon > Sent: Tuesday, April 24, 2007 7:40 AM > To: [email protected] > Subject: Re: Tutorial creates confusion about slices > > On 2007-04-24, Michael Bentley <[EMAIL PROTECTED]> w

Re: jython: user-defined modules

2007-04-25 Thread Diez B. Roggisch
Gregor Stich wrote: > Dear all, > > I hope my question is here in the right place... > What I want to achieve is a communication between Java and Python. We > have a pretty strong framework of existing python scripts and modules. > Now I want to use jython in order to faciliate the communication

Re: [python-advocacy] Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Facundo Batista
2007/4/25, Hendrik van Rooyen <[EMAIL PROTECTED]>: > Most bugs fixed in the month for the developers? > (Watch them scrabbling for the easy ones - ) > > Most Patches reviewed and incorporated? These numbers are easy to acquire. Note, though, that the name of the developer in a top ten of these

Re: When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

2007-04-25 Thread Neil Cerutti
On 2007-04-24, Thomas Nelson <[EMAIL PROTECTED]> wrote: > On Apr 23, 10:38 pm, Mel Wilson <[EMAIL PROTECTED]> wrote: >> Even with a balanced tree, if a key in a node changes value, >> you may have to re-balance the tree. Nothing in a Python list >> says that a dictionary tree would have to be re-b

Re: When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

2007-04-25 Thread Steve Holden
Neil Cerutti wrote: > On 2007-04-24, Thomas Nelson <[EMAIL PROTECTED]> wrote: >> On Apr 23, 10:38 pm, Mel Wilson <[EMAIL PROTECTED]> wrote: >>> Even with a balanced tree, if a key in a node changes value, >>> you may have to re-balance the tree. Nothing in a Python list >>> says that a dictionary

Re: Tutorial creates confusion about slices

2007-04-25 Thread Steve Holden
Antoon Pardon wrote: > On 2007-04-25, Ant <[EMAIL PROTECTED]> wrote: >> On Apr 23, 1:38 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: >>> The following is part of the explanation on slices in the >>> tutorial: >>> >>> The best way to remember how slices work is to think of the indices as >> ... >>>

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-25 Thread Steve Holden
John Nagle wrote: > Steve Holden wrote: >> John Nagle wrote: >> >>> Steve Holden wrote: >>> John Nagle wrote: [socket.error bug report] > >> All these notes should be included in the bug report, as I suspect the >> module would benefit from additional clarity. > > Done. See > >

Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread leuchte
So I read quite a few things about this phenomenon in Python 2.4.x but I can hardly believe that there is really no solution to my problem. We use a commercial tool that has a macro functionality. These macros are written in python. So far nothing extraordinary. Our (python-)macro uses massively

Re: Python un-plugging the Interpreter

2007-04-25 Thread Steve Holden
John Nagle wrote: > Alex Martelli wrote: >> Jorgen Grahn <[EMAIL PROTECTED]> wrote: >>... >> Perhaps the current wave of dual-core and quad-core CPUs in cheap consumer products would change people's perceptions -- I wonder... > >> IronPython would appear to be coming along nicely and

Re: Tutorial creates confusion about slices

2007-04-25 Thread Duncan Booth
Steve Holden <[EMAIL PROTECTED]> wrote: >> Wording to that effect makes it more clear that it is a crutch >> that can be usefull now but that it should be discarded later. >> > Most people reading a tutorial are aware that they are being given the > knowledge they need to put the subject matter

Re: PIL and font colour

2007-04-25 Thread Steve Holden
Johny wrote: > I use PIL to write some text to a picture.The text must be seen wery > clearly. > I write the text to different pictures but to the same position. As > pictures maybe different, colour, in the position where I write the > text, is also different. > Is there a way how to set the fo

Re: Tutorial creates confusion about slices

2007-04-25 Thread Neil Cerutti
On 2007-04-25, Hamilton, William <[EMAIL PROTECTED]> wrote: > That's how everything I've ever learned has been taught. Start > with a simple explanation that may not be completely accurate > but is functional, then fill in the details later when there is > a context to put them in. The tutorial c

Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Durumdara
Hi! I got same problem with Lotus Domino + Python. The lotus COM objects are not freed, so I get out from memory. I solve this problem with a little trick: I make two py applications. The first is call the second as like another application. The first is put some work to the seconds datadir. Wh

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Steve Holden
Anton Vredegoor wrote: > Steve Holden wrote: >>> When cash is involved, it's important to avoid even the slightest >>> hint of a suggestion of a suspicion of a conflict of interest; >>> that, I guess, is why firms that run contests with cash prizes >>> always declare employees and their families "

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Steve Holden
Anton Vredegoor wrote: > Antoon Pardon wrote: > That's a good point, and also a valid reason for restricting the voting community to PSF members. Thanks, Alex. >>> So in order to avoid a suspicion of a conflict of interest you want to >>> turn the whole thing into private property of th

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Steve Holden
Anton Vredegoor wrote: > Antoon Pardon wrote: >> On 2007-04-25, Anton Vredegoor <[EMAIL PROTECTED]> wrote: >>> Antoon Pardon wrote: >>> >> That's a good point, and also a valid reason for restricting the >> voting community to PSF members. Thanks, Alex. > So in order to avoid a suspicio

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Larry Bates
[EMAIL PROTECTED] wrote: > So I read quite a few things about this phenomenon in Python 2.4.x but > I can hardly believe that there is really no solution to my problem. > > We use a commercial tool that has a macro functionality. These macros > are written in python. So far nothing extraordinary.

Re: gotcha or bug? random state reset on irrelevant import

2007-04-25 Thread Alan Isaac
Alex Martelli said: > What do you mean? Just instantiate the random.Random class and you can > call .seed on it as well as anything else, and no other module will > infringe on "your" module's Random instance. The "global functions" of > module random exist for those who *SPECIFICALLY* want globa

Re: When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

2007-04-25 Thread Neil Cerutti
On 2007-04-25, Steve Holden <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> That would be documented as undefined behavior, and users >> exhorted not to do such things. >> >> Python's dictionaries are a proven winner--I'm definitely not an >> advocate for changing them. But the general require

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread TimC
Larry Bates <[EMAIL PROTECTED]> wrote: > Let's see for this I need to get out my crystal ball... > > If it is a commercial application, you should contact their tech > support for a solution. The problem isn't specifically a Python > problem but rather an implementation problem with their app. >

Re: override settrace

2007-04-25 Thread Steve Holden
Raja wrote: > Hi, > I want to override the sys.settrace() call, create a way to trace > the execution of a python program. Keep track of all objects created > and destroyed. Keep track of the call pattern throughout the execution > of the program and output a simplified "call graph" to standard o

Re: Python Screen Scraper

2007-04-25 Thread tstrokes
On Apr 24, 6:17 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 24, 2007, at 11:50 AM, James Stroud wrote: > > > > > Hello, > > > Does anyone know of an example, however modest, of a screenscraper > > authored in python? I am using Firefox. > > > Basically, I am answering problems via my br

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Chris Mellon
On 25 Apr 2007 15:04:59 GMT, TimC <[EMAIL PROTECTED]> wrote: > Larry Bates <[EMAIL PROTECTED]> wrote: > > > Let's see for this I need to get out my crystal ball... > > > > If it is a commercial application, you should contact their tech > > support for a solution. The problem isn't specifically a

Re: trinary operator - if then else

2007-04-25 Thread Nick Craig-Wood
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Michael >> > >> Does Python 2.4 support it? > > > > Not precisely, but you can *usually* get away with: > > > > a and b or c > > This is really bad advice, as long as you don't explain why it "usually" > works (and often enough not). This for exam

key detect

2007-04-25 Thread Alex Taslab
Hi everybody, does anyone know how to detect a key press from a keyboard. Well I do know how to do that, but i need to detect just one press and ignore the others. I mean, my program checks an input from the outside (a sensor) and i emulate that signal as a keypress, but the sensor doesn`t send the

Another Python Game Programming Challenge concludes

2007-04-25 Thread ???? ???
The fourth Python Game Programming Challenge (PyWeek) has now concluded with judges (PyWeek being peer-judged) declaring the winners: Individual: Which way is up? by Hectigo http://www.pyweek.org/e/Hectic/ Team: Bubble Kong by The Olde Battleaxe http://www.pyweek.org/e/toba4/ Congra

key detect

2007-04-25 Thread Alex Taslab
Hi everybody, does anyone know how to detect a key press from a keyboard. Well I do know how to do that, but i need to detect just one press and ignore the others. I mean, my program checks an input from the outside (a sensor) and i emulate that signal as a keypress, but the sensor doesn`t send the

gcov-like python code coverage

2007-04-25 Thread mathieu
Just in case something already exist for this. Is there some tool, that can produce gcov-type coverage out of a python code ? I have an already existing regex code that turn gcov output into XML, which I'd like to reuse. thanks ! -Mathieu -- http://mail.python.org/mailman/listinfo/python-list

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Grant Edwards
On 2007-04-25, Chris Mellon <[EMAIL PROTECTED]> wrote: > "Returning memory to the OS" doesn't affect exhaustion of your virtual > address space. More likely, your nested loops are just creating more > objects than is possible to hold within a single process. I'm a bit fuzzy on this, but I don't t

Re: Advocacy: "Python up, Ruby down".

2007-04-25 Thread Terry Reedy
"Paddy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I found this blog post on one users migration to Python. It states one | users frustrations but the comments section is quite good too. | | http://blog.cbcg.net/articles/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-

Re: popen2 results

2007-04-25 Thread Steven Howe
Robert Rawlins - Think Blue wrote: Hello guys, I've recently ported my application from bash to python, however there are still a few bash line utilities I -have- to use in the application as there isn't any alternative available to me. In the old days of bash I would have grep'd the output

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Steven Howe
Grant Edwards wrote: > On 2007-04-25, Chris Mellon <[EMAIL PROTECTED]> wrote: > > >> "Returning memory to the OS" doesn't affect exhaustion of your virtual >> address space. More likely, your nested loops are just creating more >> objects than is possible to hold within a single process. >>

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Terry Reedy
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Since it's the PSF's money I don't see why the voting shouldn't be | restricted to PSF members. Legally, I believe it *is* that way. And even as a non-member, I think it should be that way. Any expression of opinions

Re: q: how to output a unicode string?

2007-04-25 Thread Frank Stajano
Diez B. Roggisch wrote: >> So why is it that in the first case I got UnicodeEncodeError: 'ascii' >> codec can't encode? Seems as if, within Idle, a utf-8 codec is being >> selected automagically... why should that be so there and not in the >> first case? > > I'm a bit confused on what you did whe

Bibus/python locale not supported problem

2007-04-25 Thread Tom Chilton
Hi, I am running Gentoo Linux. I have emerge'd Bibus and everything seemed to go well. When I try to start it from a shell I get: [EMAIL PROTECTED] ~ $ bibus Traceback (most recent call last): File "/usr/share/bibus/bibus.py", line 63, in ? locale.setlocale(locale.LC_ALL,'en_US')

lowercase class names, eg., qtgui ? (PyQt4)

2007-04-25 Thread Glen
Hello, In the file generated by pyuic4 from Designer's .ui file I noticed the use of lower case class names (I'm assuming these are the names of classes, not modules). For example: It imports thusly: from PyQt4 import QtGui then uses things like: self.gridlayout = qtgui.qgridlayout(dld

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Donald 'Paddy' McCarthy
[EMAIL PROTECTED] wrote: > So I read quite a few things about this phenomenon in Python 2.4.x but > I can hardly believe that there is really no solution to my problem. > > We use a commercial tool that has a macro functionality. These macros > are written in python. So far nothing extraordinary.

Re: q: how to output a unicode string?

2007-04-25 Thread Richard Brodie
"Frank Stajano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I find the encode/decode terminology somewhat confusing, because arguably > both sides are > "encoded". For example, a unicode-encoded string (I mean a sequence of > unicode code > points) should count as "decoded"

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Grant Edwards
On 2007-04-25, Steven Howe <[EMAIL PROTECTED]> wrote: >> I'm a bit fuzzy on this, but I don't think there _is_ a >> practical way to "return memory to the OS" in many OSes. For >> example in Unix the C library uses the sbrk() call to increase >> the size of the data segment when additional memory

Re: Python Screen Scraper

2007-04-25 Thread skotjs
On Apr 24, 5:50 am, James Stroud <[EMAIL PROTECTED]> wrote: > Hello, > > Does anyone know of an example, however modest, of a screenscraper > authored in python? I am using Firefox. > > Basically, I am answering problems via my browser and being scored for > each problem. I have a tendency to go pa

Controlling gnuplot via subprocess.Popen

2007-04-25 Thread Peter Beattie
I am trying to plot something in gnuplot 4.2 using co-ordinates a Python 2.5 program computes. Here's what I'm doing: py> from subprocess import * py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE) py> plot.stdin.write("plot x*x") The first command dutifully opens gnuplot, but the secon

File not read to end

2007-04-25 Thread andrew . jefferies
Hi, I'm trying to write a simple log parsing program. I noticed that it isn't reading my log file to the end. My log is around 200,000 lines but it is stopping at line 26,428. I checked that line and there aren't any special characters. This is the file reading code segment that I'm using: s

Re: File not read to end

2007-04-25 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > > I'm trying to write a simple log parsing program. I noticed that it > isn't reading my log file to the end. > > My log is around 200,000 lines but it is stopping at line 26,428. I > checked that line and there aren't any special characters. > > This is the file

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steven Howe <[EMAIL PROTECTED]> wrote: > Interesting questions. What happens when an object is 'cleaned' up by > using the 'del' command. Does the memory space stay in the python > process, get handed back to the OS, or some combination of both? > I remember 'C' on

Re: File not read to end

2007-04-25 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > My log is around 200,000 lines but it is stopping at line 26,428. I > checked that line and there aren't any special characters. Are you in Windows? Just in case, put "rb" as the mode of the open. Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyA

Re: Would You Write Python Articles or Screencasts for Money?

2007-04-25 Thread Anton Vredegoor
Steve Holden wrote: > I'm sorry, but while the PSF is a democratically-run organization its > franchise doesn't extend beyond the membership. I didn't realize this was about an PSF internal affair. Of course a group of people can decide on its internal matters without asking anyone else, as lo

Re: KOREAN MOON revolves around BUSH

2007-04-25 Thread Major Quaternion Dirt Quantum
"Global Warning," an *anonymous* article in an old issue of *National Review*, the so-called conservative mag of the grotesque Establishment creature, William Buckley, was a sort of benignly-spun expose of the Mont Pelerin Society, the vehicle of British imperialist "free trade," free beer & free d

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-25 Thread TimC
Donald 'Paddy' McCarthy <[EMAIL PROTECTED]> wrote > Could you split the program into one handling the outer loop and > calling another program, with data transfer, to handle the inner > loops? > > - Paddy. I'm afraid this isn't possible, because the python macro is called and started from within

Re: script for seconds in given month?

2007-04-25 Thread skip
ed> I, unfortunately, failed to realize the actual platform the script ed> is for is IronPython. When trying to import calendar in IronPython, ed> I get: ed> SyntaxError: future feature is not defined: with_statement ed> (c:\Python25\Lib\calendar.py, line 8) So try the 2.4 v

conditional print statement ?

2007-04-25 Thread Stef Mientki
hello, As part of a procedure I've a number sequences like this: if Print_Info: print Datafile.readline() else:Datafile.readline() Is there a more compressed way to write such a statement, especially I dislike the redundancy "Datafile.readline()". thanks, Stef Mient

Re: conditional print statement ?

2007-04-25 Thread Martin v. Löwis
Stef Mientki schrieb: > hello, > > > As part of a procedure I've a number sequences like this: > > > if Print_Info: print Datafile.readline() > else:Datafile.readline() > > > Is there a more compressed way to write such a statement, > especially I dislike the redundanc

bitwise shift?

2007-04-25 Thread desktop
I have found a code example with this loop. for k in range(10, 25): n = 1 << k; I have never read Python before but is it correct that 1 get multiplied with the numbers 10,11,12,12,...,25 assuming that 1 << k means "1 shift left by k" which is the same as multiplying with k. -- http://

Embedding Matplotlib in wxpython wx.Panel problem

2007-04-25 Thread Soren
Hi, I'm trying to create a small GUI program where I can do plots using Matplotlib. I've been trying to borrow code from the examples at the matplotlib website, but I can't get it to work. I want to be able to create a wx.Panel that contains an axis for plotting. Around it i want other panels con

Re: bitwise shift?

2007-04-25 Thread Michael Hoffman
desktop wrote: > I have found a code example with this loop. > > for k in range(10, 25): > n = 1 << k; > > > I have never read Python before but is it correct that 1 get multiplied > with the numbers 10,11,12,12,...,25 No. > assuming that 1 << k means "1 shift left by k" Yes. > which

Re: getting scancodes

2007-04-25 Thread faulkner
On Apr 23, 8:39 pm, [EMAIL PROTECTED] wrote: > Anyone knows if its possible to get scan codes ??? > I tried with getch () but with no success, just keycodes. > May be using the something in the sys.stdin module ?? is this what you're looking for? http://cheeseshop.python.org/pypi/sysio/1.0 and sy

Re: bitwise shift?

2007-04-25 Thread Jean-Paul Calderone
On Wed, 25 Apr 2007 22:54:12 +0200, desktop <[EMAIL PROTECTED]> wrote: >I have found a code example with this loop. > >for k in range(10, 25): > n = 1 << k; > > >I have never read Python before but is it correct that 1 get multiplied >with the numbers 10,11,12,12,...,25 assuming that 1 << k m

Re: bitwise shift?

2007-04-25 Thread Thomas Krüger
desktop schrieb: > I have found a code example with this loop. > > for k in range(10, 25): > n = 1 << k; > > > I have never read Python before but is it correct that 1 get multiplied > with the numbers 10,11,12,12,...,25 assuming that 1 << k means "1 shift > left by k" which is the same as

Re: bitwise shift?

2007-04-25 Thread Sherm Pendley
desktop <[EMAIL PROTECTED]> writes: > for k in range(10, 25): > n = 1 << k; > > I have never read Python before but is it correct that 1 get > multiplied with the numbers 10,11,12,12,...,25 assuming that 1 << k > means "1 shift left by k" which is the same as multiplying with k. Shift left

Re: Controlling gnuplot via subprocess.Popen

2007-04-25 Thread Ben C
On 2007-04-25, Peter Beattie <[EMAIL PROTECTED]> wrote: > I am trying to plot something in gnuplot 4.2 using co-ordinates a Python > 2.5 program computes. Here's what I'm doing: > > py> from subprocess import * > py> plot = Popen("c:/progs/gp/bin/wgnuplot.exe", stdin=PIPE) > py> plot.stdin.write("p

Re: Tutorial creates confusion about slices

2007-04-25 Thread Ant
On Apr 23, 1:38 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > The following is part of the explanation on slices in the > tutorial: > > The best way to remember how slices work is ... > +---+---+---+---+---+ > | H | e | l | p | A | > +---+---+---+---+---+ > 0 1 2 3 4 5 > -5 -4

Re: Another Python Game Programming Challenge concludes

2007-04-25 Thread Terry Reedy
" ???" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The fourth Python Game Programming Challenge (PyWeek) has now concluded | with | judges (PyWeek being peer-judged) declaring the winners: | | Individual: Which way is up? by Hectigo |http://www.pyweek.org/e/Hectic/ | |

Re: bitwise shift?

2007-04-25 Thread Terry Reedy
"desktop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I have found a code example with this loop. | | for k in range(10, 25): | n = 1 << k; | | | I have never read Python before but is it correct ... One of the super-nice feature of Python is the interactive mode, also av

  1   2   >