Re: Python CGI problem: correct result, but incorrect browser response.

2006-04-06 Thread Tim Roberts
"Sullivan WxPyQtKinter" <[EMAIL PROTECTED]> wrote: > >title:Python CGI problem: correct result, but incorrect browser >response. > >In one of my CGI program,named 'login.py', the script return a HEADER >to web browser: > >Set-Cookie: sessionID=LAABUQLUCZIQJTZDWTFE; >Set-Cookie: username=testuser; >

Re: Partially unpacking a sequence

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Thank you, everyone, for resolving my question. At one point, while > trying to solve the problem, I typed > > >>> y[1,3] > Traceback (most recent call last): > File "", line 1, in ? > TypeError: list indices must be integers > > The error message gave me no clue as to

Re: Simple string formatting question

2006-04-06 Thread Fredrik Lundh
Paul McGuire wrote: > Ooops, don't combine the two calls to rstrip(). > > def format(f, width=3): return ("%.*f" % (width, f)).rstrip(".0") > > print format(3.140) > print format(3.000) > print format(3.001) > print format(30.) > print format(30.000) hey, I'm doing test-driven develop

Re: Unicode, command-line and idle

2006-04-06 Thread a . serrano
Martin v. Löwis wrote: > [EMAIL PROTECTED] wrote: > > This works if I use the console but gives the following error if I use > > IDLE: > > > > Traceback (most recent call last): > > File "C:\test.py", line 4, in ? > > text2 = unicode(raw_input(), sys.stdin.encoding) > > AttributeError: PyShe

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread Lonnie Princehouse
Here's my take on the thing. It only prints one term, though. http://www.magicpeacefarm.com/lonnie/code/morris.py.html (a bit too long to post) -- http://mail.python.org/mailman/listinfo/python-list

Re: good style guides for python-style documentation ?

2006-04-06 Thread sushant . sirsikar
Fredrik Lundh wrote: > (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any su

Re: How to create a tear off menu in TKinter. Help Needed

2006-04-06 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, ishtar2020 <[EMAIL PROTECTED]> wrote: >Hi everybody > >I'd appreciate some help on creating a tear off menu with TkInter. I've >been reading some documentation but still no luck. > >Please don't get confused: when I mean "tear off" menu I don't mean a >drop-down or a

my vote for handy python system admin tool

2006-04-06 Thread [EMAIL PROTECTED]
denyhosts denyhosts.sourceforge.net I used it at a recent contract sys. admin job, and found it so handy I installed it on my home gateway FreeBSD box. It ROCKS!!! I watch the system logs just to snicker when it stops a sshd attack dead in its tracks ;-0 Curtis -- http://mail.python.org/mailma

Re: BIOCHIP --->>> NO GOOD !!

2006-04-06 Thread [EMAIL PROTECTED]
okay wrote: > Hello, > > > http://www.av1611.org/666/biochip.html > > To Archbishop Christodoulos Paraskevaides of the Greek Orthodox Church > in Athens and Greece > Archbishop, > I talked with a Greek Orthodox believer in Australia and he told me two > I'm thinking a list comprehension... -- h

Re: HTMLParser fragility

2006-04-06 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Rene Pijlman <[EMAIL PROTECTED]> wrote: >2. Use something more foregiving, like BeautifulSoup. >http://www.crummy.com/software/BeautifulSoup/ That sounds like what I'm after! -- http://mail.python.org/mailman/listinfo/python-list

Re: confusing behaviour of os.system

2006-04-06 Thread Ben Finney
"Todd" <[EMAIL PROTECTED]> writes: > Ben Cartwright wrote: > > >>> print '/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file> > > >>> \"test.c\")"' > > /usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file> "test.c")" > > >>> print '/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread Ben Cartwright
John Salerno wrote: > Actually I was just thinking about this and it seems like, at least for > my purpose (to simply return a list of numbers), I don't need a > generator. Yes, if it's just a list of numbers you need, a generator is more flexibility than you need. A generator would only come in

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
Ben Cartwright wrote: > Definitely go for (1). The Morris sequence is a great candidate to > implement as a generator. As a generator, it will be more flexible and > efficient than (2). Actually I was just thinking about this and it seems like, at least for my purpose (to simply return a list

Re: updated pre-PEP: The create statement

2006-04-06 Thread Carl Banks
Steven Bethard wrote: > I've updated the PEP based on a number of comments on comp.lang.python. > The most updated versions are still at: > > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html > > In this post, I'

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread Ben Cartwright
John Salerno wrote: > It > is meant to take a number and generate the next number that follows > according to the Morris sequence. It works for a single number, but what > I'd like it to do is either: > > 1. repeat indefinitely and have the number of times controlled elsewhere > in the program (e.g

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread Lonnie Princehouse
The generator in your original post /does/ rebind seed, but only on the last iteration of the loop. You'll need to wrap that loop in another loop if you want the generator to yield more than once. As for "communicating" with a generator --- e.g. telling it to stop --- this might be done by passin

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Steven> Optional Extensions > Steven> === > > Steven> Remove the create keyword > Steven> - > > Steven> It might be possible to remove the create keyword so that such > Steven> statements would begin with t

glob and curly brackets

2006-04-06 Thread Zain Homer
Someone please let me know if I'm sending this to the wrong email alias... I'm wondering why we can't use the glob module to glob with curly brackets like we can from the command line (at least in tcsh). Is there a shell standard for which the python glob module has been designed which prevents t

Re: updated pre-PEP: The create statement

2006-04-06 Thread skip
Steven> Optional Extensions Steven> === Steven> Remove the create keyword Steven> - Steven> It might be possible to remove the create keyword so that such Steven> statements would begin with the callable being called, e.g.:: Ste

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
John Salerno wrote: > 2. just make it a function that takes a second argument, that being the > number of times you want it to repeat itself and create numbers in the > sequence Here's what I've come up with so far. Probably not the most elegant solution because of the nested function, but it d

Training/conventions featuring non-introductory Python

2006-04-06 Thread Jeff
Hey all, I'm looking around to see how best to spend the training monies allocated me by my employer for this year, and haven't really ever done this sort of thing before. I work primarily with Python (Django, Zope, and assorted small apps and scripts) so what would be best is something that is pr

Re: confusing behaviour of os.system

2006-04-06 Thread Todd
Ben Cartwright wrote: > Todd wrote: > > I'm trying to run the following in python. > > > > os.system('/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file > > \"test.c\")"') > > Python is interpreting the \"s as "s before it's being passed to > os.system. Try doubling the backslashes. > > >>

Re: 32-bit python on Opteron, Solaris 10?

2006-04-06 Thread ross lazarus
The answers depend entirely on the cpu in my experience. I'm staring at http://www.sun.com/servers/index.jsp and I can't see anything called a T2100. I have 3 X2100 servers which are opterons. Psyco only runs on x86 cpu hardware. Python cannot use psyco on opterons at all - 32 bit mode or other

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
John Salerno wrote: > 1. repeat indefinitely and have the number of times controlled elsewhere > in the program (e.g., use the morris() generator in a for loop and use > that context to tell it when to stop) > > 2. just make it a function that takes a second argument, that being the > number o

how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
Ok, I wrote this all by myself, which explains why it doesn't work. It is meant to take a number and generate the next number that follows according to the Morris sequence. It works for a single number, but what I'd like it to do is either: 1. repeat indefinitely and have the number of times co

Re: confusing behaviour of os.system

2006-04-06 Thread Ben Cartwright
Todd wrote: > I'm trying to run the following in python. > > os.system('/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file > \"test.c\")"') Python is interpreting the \"s as "s before it's being passed to os.system. Try doubling the backslashes. >>> print '/usr/bin/gnuclient -batch -l htm

Re: pre-PEP: The create statement

2006-04-06 Thread Ben Cartwright
Michael Ekstrand wrote: > Is there a natural way > to extend this to other things, so that function creation can be > modified? For example: > > create tracer fib(x): > # Return appropriate data here > pass > > tracer could create a function that logs its entry and exit; behavior > could be

OpenGL on Intel Mac

2006-04-06 Thread Brian Victor
I am attempting to build PyOpenGL on my Intel iMac. The transcript of the build failure is here: http://brianhv.org/temp/pyopengl-build.log I'm using the universal MacPython 2.4.3 and PyOpenGL-2.0.1.09. The highlight of the build log is: /System/Library/Frameworks/Kernel.framework/Headers/sys/s

Re: Missing C modules in 2.5 on OS X?

2006-04-06 Thread Jay Parlar
On Apr 6, 2006, at 3:25 PM, Jay Parlar wrote: > I just downloaded, built, and installed the new 2.5 alpha on OS X > 10.3, and it seems that the new 'functional' didn't get installed. > > I know that it got built (done from the 2.5 source directory): > > Jay-Computer:~/Desktop/Python-2.5a1 jaypar

confusing behaviour of os.system

2006-04-06 Thread Todd
I'm trying to run the following in python. os.system('/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file \"test.c\")"') This connects to xemacs with gnuclient and runs htmlize. If I run it from a shell, xemacs gives me an error, but it generates the html file just fine. If I run the same

Re: binding - python

2006-04-06 Thread John McMonagle
On Thu, 2006-04-06 at 16:39 -0700, beta wrote: > Hi John, > > It works! thank you vey much. > > I have another question. I would very appreciated if you have any clue. > > I want the ball STOP whenever mouse is clicked anywhere, then ball KEEP > MOVING when next mouse click is applied. Thanks. >

Re: output formatting for user-defined types

2006-04-06 Thread Russ
>I'm sorry, your system of units doesn't allow trig functions to operate on >degrees? I presume you don't allow grads either. What about steradians or >other arbitrary measures of angle or solid angle? I should have stated that more clearly. You can enter the value in degrees, but it will automati

Re: Simple string formatting question

2006-04-06 Thread Ben Finney
"Steven D'Aprano" <[EMAIL PROTECTED]> writes: > On Thu, 06 Apr 2006 22:16:05 +1000, Ben Finney wrote: > > "Steven D'Aprano" <[EMAIL PROTECTED]> writes: 1> >> I'm looking for a format string similar to '%.3f' except that > >> trailing zeroes are not included. > > > > Can;t be done, to my knowledge

Re: binding - python

2006-04-06 Thread beta
Hi John, It works! thank you vey much. I have another question. I would very appreciated if you have any clue. I want the ball STOP whenever mouse is clicked anywhere, then ball KEEP MOVING when next mouse click is applied. Thanks. Regards, Quoc -- http://mail.python.org/mailman/listinfo/pyth

Can't Delete a Thread

2006-04-06 Thread flamesrock
I have the following two threads, called from a method: def uploading_region: uploading_region = AddRegionToServerThread(self,self.SESSION,create_region) while uploading_region.UPLOADING: pass #escape method when uploading_region thread is false

Re: output formatting for user-defined types

2006-04-06 Thread Steven D'Aprano
On Thu, 06 Apr 2006 11:05:06 -0700, Russ wrote: >>Really, your response seems a little bizarre to me, given that __float__ >>is the defined way in which float() gets a value from an instance, and >>float() is what the % operator calls when it encounters a '%f' in the >>format string. > > My class

Re: good style guides for python-style documentation ?

2006-04-06 Thread Ziga Seilnacht
Fredrik Lundh wrote: > (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any sug

Re: python on Mac

2006-04-06 Thread Thomas Nelson
Ok, I fixed my /usr/bin/python and added /usr/public/bin/ to my PATH in .profile. Everything seems ok now. Thanks again to everyone for their help. THN -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple string formatting question

2006-04-06 Thread Steven D'Aprano
On Thu, 06 Apr 2006 22:16:05 +1000, Ben Finney wrote: > "Steven D'Aprano" <[EMAIL PROTECTED]> writes: >> I'm looking for a format string similar to '%.3f' except that >> trailing zeroes are not included. > > Can;t be done, to my knowledge. You specify a particular precision, > and the number wil

Re: Unicode, command-line and idle

2006-04-06 Thread John Machin
The docs say that the encoding attribute is "New in version 2.3". Python 2.2's IDLE produces exactly the exception reported by the OP. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a tear off menu in TKinter. Help Needed

2006-04-06 Thread John McMonagle
On Thu, 2006-04-06 at 12:27 -0700, ishtar2020 wrote: > Hi everybody > > I'd appreciate some help on creating a tear off menu with TkInter. I've > been reading some documentation but still no luck. > > Please don't get confused: when I mean "tear off" menu I don't mean a > drop-down or a pop-up me

Re: Unicode, command-line and idle

2006-04-06 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > This works if I use the console but gives the following error if I use > IDLE: > > Traceback (most recent call last): > File "C:\test.py", line 4, in ? > text2 = unicode(raw_input(), sys.stdin.encoding) > AttributeError: PyShell instance has no attribute 'encoding'

Re: Partially unpacking a sequence

2006-04-06 Thread jUrner
>> Thank you, everyone, for resolving my question. At one point, while >> trying to solve the problem, I typed >> > y[1,3] >> >> Traceback (most recent call last): >> File "", line 1, in ? >> TypeError: list indices must be integers >> >> The error message gave me no clue as to what I was doin

Re: Partially unpacking a sequence

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: y[1,3] > Traceback (most recent call last): > File "", line 1, in ? > TypeError: list indices must be integers > > The error message gave me no clue as to what I was doing wrong (in > my mind, I was just writing out the elements of a range), and I > tho

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Georg Brandl <[EMAIL PROTECTED]> wrote: >Alan Morgan wrote: > >>>range is giving you a real list, while xrange is giving you an xrange object. >>>Have you tried to slice an xrange object? Or using .append on it? >> >> No, I hadn't. I presume these could all be def

Re: Partially unpacking a sequence

2006-04-06 Thread Fredrik Lundh
Paul McGuire wrote: > Forgot one: > > _,_,a,_,b,_,_,_ = y > > There actually is some merit to this form. If the structure of y changes > sometime in the future (specifically if a field is added or removed), this > statement will fail noisily, calling your attention to this change. But if > a ne

Re: good style guides for python-style documentation ?

2006-04-06 Thread John Salerno
Fredrik Lundh wrote: > (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any

Re: Partially unpacking a sequence

2006-04-06 Thread tkpmep
Thank you, everyone, for resolving my question. At one point, while trying to solve the problem, I typed >>> y[1,3] Traceback (most recent call last): File "", line 1, in ? TypeError: list indices must be integers The error message gave me no clue as to what I was doing wrong (in my mind, I was

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Fredrik Lundh
Carl Banks wrote: > > I wondered if the Python compiler could, as a special case, turn: > > > > for i in range(n) > > > > into compiled code equivalent to > > > > for i in itr > > > > where "itr" is a lightweight iterator that returns the same values as > > iter(range(n)). > > Nope, out of the que

Missing C modules in 2.5 on OS X?

2006-04-06 Thread Jay Parlar
I just downloaded, built, and installed the new 2.5 alpha on OS X 10.3, and it seems that the new 'functional' didn't get installed. I know that it got built (done from the 2.5 source directory): Jay-Computer:~/Desktop/Python-2.5a1 jayparlar$ find . -iname functional* ./build/lib.darwin-7.9.0-Po

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Steve R. Hastings
On Wed, 05 Apr 2006 22:08:29 -0700, Carl Banks wrote: >> for i in range(n) >> >> into compiled code equivalent to >> >> for i in itr >> >> where "itr" is a lightweight iterator that returns the same values as >> iter(range(n)). > Nope, out of the question for Python 2.x. Note that the the builtin

Re: "definitive" source on advanced python?

2006-04-06 Thread Russ Salsbury
[EMAIL PROTECTED] wrote: > vdrab wrote: > > Hi all, > > > > Is there some sort of coherent source (dead tree format, maybe?) on > > some of the more advanced features > > of python (decorators, metaclasses, etc)? I'm sort of looking for a > > If you just want a good book in feature description I

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 4)

2006-04-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, gene tani <[EMAIL PROTECTED]> wrote: > >Peter Otten wrote: >> The old Python "To-Do List" now lives principally in a >> SourceForge reincarnation. >> http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse >> http://python.source

standard library audio/image support

2006-04-06 Thread Johan Kotlinski
Hi there! I spent the afternoon making a simple graphics-to-audio converter.. I was surprised to find that the AIFF parser/writer is in the standard library, but that I had to go to some external library for opening and manipulating a JPG file. How come audio is deemed more important for the sta

Re: Partially unpacking a sequence

2006-04-06 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I have a list y > > >>>y > > ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', > > '19.500', '224'] > > > > from which I want to extract only t

Re: Partially unpacking a sequence

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have a list y > >>>y > ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', > '19.500', '224'] > > from which I want to extract only the 2nd and 4th item by partially > unpacking the list. So I tried > >>>a,b = y[2,4] > Traceback (most recent call last): >

Re: Partially unpacking a sequence

2006-04-06 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a list y > >>>y > ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', > '19.500', '224'] > > from which I want to extract only the 2nd and 4th item by partially > unpacking the list. So I tried > >>>a,b = y[2,4] > Trace

Re: good style guides for python-style documentation ?

2006-04-06 Thread Ron Adam
> (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any suggestions from this

Partially unpacking a sequence

2006-04-06 Thread tkpmep
I have a list y >>>y ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', '19.500', '224'] from which I want to extract only the 2nd and 4th item by partially unpacking the list. So I tried >>>a,b = y[2,4] Traceback (most recent call last): File "", line 1, in ? TypeError: list indices

Re: XMLRPCLIB appears to be broken?

2006-04-06 Thread flamesrock
Ughhh I feel like such an idiot :( Thanks for clearing that up it works now. -- http://mail.python.org/mailman/listinfo/python-list

How to create a tear off menu in TKinter. Help Needed

2006-04-06 Thread ishtar2020
Hi everybody I'd appreciate some help on creating a tear off menu with TkInter. I've been reading some documentation but still no luck. Please don't get confused: when I mean "tear off" menu I don't mean a drop-down or a pop-up menu, but those options which yield to another batch of sub-options w

good style guides for python-style documentation ?

2006-04-06 Thread Fredrik Lundh
(reposted from doc-sig, which seems to be mostly dead these days). over at the pytut wiki, "carndt" asked: Are there any guidelines about conventions concerning punctuation, text styles and language style (e.g. how to address the reader)? any suggestions from this list ? -- htt

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Terry Reedy wrote: > "Michele Simionato" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> This is a very relevant question. I would expect the new keyword would >> break lots >> of modules. However measuring is better than speculating. > > Please run also with alternatives, such a

Re: how to create file with spaces

2006-04-06 Thread infidel
dirpath is just a string, so there's no sense in putting it in a list and then iterating over that list. If you're trying to do something with each file in the tree: for dir, subdirs, names in os.walk(rootdir): for name in names: filepath = os.path.join(dir, name) + "-dummy" i

Re: XMLRPCLIB appears to be broken?

2006-04-06 Thread Fredrik Lundh
"flamesrock" wrote: > I'm using IXR_library, which is one of the defato xml-rpc libs out > there. It seems to be working for other people... > > The reason I think its a python error is because php doesn't understand > lists, which is what the data is being returned as. umm. xml-rpc is a platfor

Re: XMLRPCLIB appears to be broken?

2006-04-06 Thread flamesrock
Thanks for the response. I'm using IXR_library, which is one of the defato xml-rpc libs out there. It seems to be working for other people... The reason I think its a python error is because php doesn't understand lists, which is what the data is being returned as. -- http://mail.python.org/mai

Re: HTMLParser fragility

2006-04-06 Thread Paul Boddie
Richie Hindle wrote: > > But Tidy fails on huge numbers of real-world HTML pages. Simple things like > misspelled tags make it fail: > > >>> from mx.Tidy import tidy > >>> results = tidy("Hello world!") [Various error messages] > Is there a Python HTML tidier which will do as good a job as a bro

Re: help with designing an app. based on ConfigParser

2006-04-06 Thread Fuzzyman
Alexandre CONRAD wrote: [snip..] > > So I told my self, the best way would be able to have a "sub-section". I > could then look for all servers (aka sub-sections) inside [UPDATE > SERVERS] and retrieve the needed info. But AFAIK, it's not possible > having sub-sections with ConfigParser. So I'm he

Re: output formatting for user-defined types

2006-04-06 Thread Russ
>Yeah, how about we read your mind or make wild guesses about why it's >not acceptable, and about what your requirements really are. >Really, your response seems a little bizarre to me, given that __float__ >is the defined way in which float() gets a value from an instance, and >float() is what th

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Fredrik Lundh
Just wrote: > > Robin Haswell wrote: > > > Hey guys. This should just be a quickie: I can't figure out how to convert > > > r"\x2019" to an int - could someone give me a hand please? > > > > Is this what you mean? > > In [9]: int(r'\x2019'[2:], 16) > > Out[9]: 8217 > > > > or maybe you meant this:

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Just
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > Robin Haswell wrote: > > Hey guys. This should just be a quickie: I can't figure out how to convert > > r"\x2019" to an int - could someone give me a hand please? > > Is this what you mean? > In [9]: int(r'\x2019'[2:], 16)

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Kent Johnson
Robin Haswell wrote: > Hey guys. This should just be a quickie: I can't figure out how to convert > r"\x2019" to an int - could someone give me a hand please? Is this what you mean? In [9]: int(r'\x2019'[2:], 16) Out[9]: 8217 or maybe you meant this: In [6]: ord(u'\u2019') Out[6]: 8217 Kent --

Re: RELEASED Python 2.5 (alpha 1)

2006-04-06 Thread Terry Reedy
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Michael Ekstrand wrote: >> The day Python (without using Stackless) has true continuations will be >> a happy day. Don't hold your breath. Guido regards 'true continuations' as complexity overload for the typical

Quickie: converting r"\x2019" to int

2006-04-06 Thread Robin Haswell
Hey guys. This should just be a quickie: I can't figure out how to convert r"\x2019" to an int - could someone give me a hand please? Cheers -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Cleaning the current environment after a fork

2006-04-06 Thread Robin Haswell
On Thu, 06 Apr 2006 12:47:25 +0200, Diez B. Roggisch wrote: > And even if that wasn't the case: I think as long as you don't run into > memory-troubles, don't do it. Its complex, flaky and thus an unnecessary > source of failure. Yeah that sounds fair enough. Actually I ran in to threading proble

Re: pre-PEP: The create statement

2006-04-06 Thread Terry Reedy
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is a very relevant question. I would expect the new keyword would > break lots > of modules. However measuring is better than speculating. Please run also with alternatives, such as 'make'. tjr -- http://

Re: pre-PEP: The create statement

2006-04-06 Thread Terry Reedy
"Azolex" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'd advocate for the shortest possible keyword, and - maybe because > English is not my native language - I'd thus prefer "make" if any is > really required. While currently +0 on the proposal, I am +1 on 'make' versus 'creat

32-bit python on Opteron, Solaris 10?

2006-04-06 Thread Gary Robinson
I'm in the market for a server to run some python code which is optimized via psyco. Sun T2100 servers come with Solaris 10, which comes with python pre-installed. Since those servers use the 64-bit Opteron box, I would assume that the Python is a 64-bit version. (Does anyone know whether thi

Docstring line wrapping in C modules?

2006-04-06 Thread Kelvie Wong
While writing docstrings in C, they don't get wrapped properly (i.e., lines will break in the middle of a word) when invoking the `help' function. Is there any way to have Python break lines automatically, or do I have to write my own C function/vim script to do it? Kelvie -- http://mail.python.

ANN: ActivePython 2.4.3.11 is now available

2006-04-06 Thread Trent Mick
I'm happy to announce that ActivePython 2.4.3.11 is now available for free download from: http://www.ActiveState.com/Products/ActivePython/ This release is a maintenance/update release for existing platforms. Changes in this release include: - [Windows] Update to recent PyWin32 (build 208.1+)

Re: how to create file with spaces

2006-04-06 Thread Larry Bates
Fulvio wrote: > Alle 18:18, giovedì 06 aprile 2006, [EMAIL PROTECTED] ha scritto: >> How can i deal with spaces in this case? > I don't have an idea with python, but if can help I may say that bash you > might use "\ " to escape a space or use a quoted full path. > The shell program "basename" is

Re: How to work with directories and files with spaces

2006-04-06 Thread Larry Bates
[EMAIL PROTECTED] wrote: > hi > > I am working in unix and i have some directories names with spaces > eg ABC DEF A > how can i work effectively with spaces in directory/file names in > python? > > sometimes when i do os.path.join(dir_with_spaces,"-somestring" ) , it > gives me "-somestring" as

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Steven Bethard wrote: > I've updated the PEP based on a number of comments on comp.lang.python. > The most updated versions are still at: > > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html > > In this post, I

Re: shelve and ".bak .dat .dir" files

2006-04-06 Thread Michele Petrazzo
Sion Arrowsmith wrote: > > This is a documented behaviour of shelve: Sorry, I had read only the: """Open a persistent dictionary. The filename specified is the base filename""" ... :) > I guess this depends on what dbm shelve is built on the documentation > implies it goes through anydbm. I'm no

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michele Simionato wrote: > Steven Bethard wrote: >> I've updated the PEP based on a number of comments on comp.lang.python. >> The most updated versions are still at: >> >> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt >> http://ucsu.colorado.edu/~bethard/py/pep_create_sta

Re: GUI issues in Python

2006-04-06 Thread Thomas Jollans
[EMAIL PROTECTED] wrote: > My question basically revolves around... that I dont want to draw > circles and boxes for drawing purposes. > > I want the end user to be able to draw the GUI boxes and circles and > makes connection to depict states and dependencies. So its a little > unconventional an

Re: How can I get the text under the cusor ?

2006-04-06 Thread Fredrik Lundh
"Bo Yang" wrote: > I want to develop an application to record some of the best words and > ideas in the web when I surfing with the Firefox or IE . > I would like the application have such a GUI : > 1.it appear in the system tray area in the Windows ; > 2.whenever I select some words (ether in an

How can I get the text under the cusor ?

2006-04-06 Thread Bo Yang
Hello , I want to develop an application to record some of the best words and ideas in the web when I surfing with the Firefox or IE . I would like the application have such a GUI : 1.it appear in the system tray area in the Windows ; 2.whenever I select some words (ether in an IE or MS word),I hop

Re: updated pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Steven Bethard wrote: > I've updated the PEP based on a number of comments on comp.lang.python. > The most updated versions are still at: > > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html > > In this post, I'

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michele Simionato wrote: > Carl Banks wrote: >>> create module mod: >>> "This creates a sub-module named mod with an f1 function" >>> >>> def f1(): >>> ... >> Let's not do this, really. A module should be one-to-one with a file, >> and you should be able to impo

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Carl Banks wrote: > My biggest concern with this is the special arguments of the caller. > It breaks my heart that we couldn't do something like this: > > create dict keymap: > A = 1 > B = 2 > > And it'll probably confuse people as well. We ought to keep that in > mind. > > > > Of course,

Re: "definitive" source on advanced python?

2006-04-06 Thread pruebauno
vdrab wrote: > Hi all, > > Is there some sort of coherent source (dead tree format, maybe?) on > some of the more advanced features > of python (decorators, metaclasses, etc)? I'm sort of looking for a If you just want a good book in feature description I recomend Python in a Nutshell. It will ex

updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html In this post, I'm especially soliciting review of

Re: python on Mac

2006-04-06 Thread Robert Kern
Thomas Nelson wrote: > Well, as I stated in post, I've already replaced the link at > /usr/bin/python. I'm not clear why that's unhealthy. The FAQ describes why it's unhealthy in detail. "FAQ 5.7 Describe Apple's Framework implementation of Python and how that affects me adding new Python imple

Re: Difference in Python and Ruby interactive shells

2006-04-06 Thread dmh2000
Thanks all for the responses. Extra kudos to Steve J and Michele S. that cleared it up for me. the context of my question comes from reading up on Lisp in "Loving Lisp - the Savy Programmer's Secret Weapon", http://www.markwatson.com/opencontent/lisp_lic.htm, where the author described building up

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Sion Arrowsmith wrote: > Michele Simionato <[EMAIL PROTECTED]> wrote: > >Sion Arrowsmith wrote: > >> A quick scan of the standard library suggests that it will have > >> a grand total of 3 modules requiring a fix (it's a method name > >> in imaplib and a named argument in a couple of places in bsdd

xml <-> python Re: pre-PEP: The create statement

2006-04-06 Thread Azolex
Steven Bethard wrote: ... > > Optional Extensions > === > > Remove the create keyword > - > > It might be possible to remove the create keyword so that such > statements would begin with the callable being called, e.g.: > > module mod: > def f

[fcntl]how to lock a file

2006-04-06 Thread marcello
Hello I need to do this: 1 opening a file for writing/appending 2 to lock the file as for writing (i mean: the program that lock can keep writing, all others programs can't ) 3 wtite and close/unlock Even better would be changing the order of steps 1 and 2 (that is,first locking than writing,

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Carl Banks wrote: > Steven Bethard wrote: >> This PEP proposes a generalization of the class-declaration syntax, >> the ``create`` statement. The proposed syntax and semantics parallel >> the syntax for class definition, and so:: >> >> create : >> >> >> is translated into the assignm

Re: pre-PEP: The create statement

2006-04-06 Thread Sion Arrowsmith
Michele Simionato <[EMAIL PROTECTED]> wrote: >Sion Arrowsmith wrote: >> A quick scan of the standard library suggests that it will have >> a grand total of 3 modules requiring a fix (it's a method name >> in imaplib and a named argument in a couple of places in bsddb >> and distutils). Your own cod

  1   2   3   >