Re: Give me the google group address in Chinese.

2007-04-22 Thread John Machin
On Apr 22, 12:16 pm, 坏蛋 <[EMAIL PROTECTED]> wrote: > It's really annoying to find there are all English language posts here > because I wanna talk about something about the Chinese related > programs. > > Could you give me some ? http://python.cn/ -- (CPUG) Chinese Python Users' Group There is a

Re: Give me the google group address in Chinese.

2007-04-22 Thread John Machin
On Apr 22, 1:44 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 21 Apr 2007 19:16:37 -0700, »µµ° <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > It's really annoying to find there are all English language posts here > > because I wanna talk about something about the C

Re: Flat DB seeking speed

2007-04-22 Thread hugonz
Jia Lu skribis: > Hello all > > I see there are lots of flat db or db-like modules in the standard > python modules. > What about the keywords seeking speed of them ? > > (I want to put about 1 articles with 1 IDs, and I can do > searching keywords with them) > > The db-like modules are

Re: Suggestion: str.itersplit()

2007-04-22 Thread Stargaming
subscriber123 schrieb: > On Apr 21, 8:58 am, Dustan <[EMAIL PROTECTED]> wrote: > >>>From my searches here, there is no equivalent to java's >> >>StringTokenizer in python, which seems like a real shame to me. >> >>However, str.split() works just as well, except for the fact that it >>creates it al

Re: Python for Vcard Parsing in UTF16

2007-04-22 Thread R Wood
Alex Martelli wrote: > R Wood <[EMAIL PROTECTED]> wrote: >... >> alias Linus_Torvalds Linus Torvalds <[EMAIL PROTECTED]> >> >> To me this was a natural task for Perl. Turns out however, there's a >> catch. Apple exports the file in UTF-16 to ensure anyone with Chinese >> characters in >> the

Re: Namespaces/introspection: collecting sql strings for validation

2007-04-22 Thread Peter Otten
Martin Drautzburg wrote: > I would like to validate sql strings, which are spread all over the > code, i.e. I run ("prepare") them against a database to see if it happy > with the statements. Spelling errors in sql have been a major pain for > me. > > The statements will not be assembled from sma

Re: Python "robots.txt" parser broken since 2003

2007-04-22 Thread John Nagle
Terry Reedy wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | This was reported in 2003, and a patch was uploaded in 2005, but the > patch > | never made it into Python 2.4 or 2.5. > > If the patch is still open, perhaps you could review it. > I tried

Re: Select weirdness

2007-04-22 Thread Bjoern Schliessmann
Ron Garret wrote: > print>>self.wfile, 'HTTP/1.0 200 OK' > print>>self.wfile, 'Content-type: text/plain' > print>>self.wfile > print>>self.wfile, 'foo' > [...] > If I telnet into this server and type in an HTTP request manually > it works fine. But when I try to access this with a

Re: Support for new items in set type

2007-04-22 Thread Prateek
On Apr 22, 11:09 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 21 Apr 2007 20:13:44 -0700, Prateek wrote: > > I have a bit of a specialized request. > > > I'm reading a table of strings (specifically fixed length 36 char > > uuids generated via uuid.uuid4() in the standard library) from

Re: service for file monitoring

2007-04-22 Thread bryan rasmussen
use WMI event monitoring objWMIService.ExecNotificationQuery http://msdn2.microsoft.com/en-us/library/aa393864.aspx , then pass the event and the file starting the event to your application via the command line, what I tend to do (so I keep one monitor running that starts applications at event oc

Access to file dropped on .exe/.app icon

2007-04-22 Thread Martin
If i create an app using py2exe/py2app is there then a way on windows/ mac to get access to a file dragged and dropped on to the .exe/.app icon? Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Do other Python GUI toolkits require this?

2007-04-22 Thread René Fleschenberg
Antoon Pardon schrieb: >> Who says the axes are labeled "familiarity" and "learning period"? I >> just assume they are labeled (y-axis) "Effort" and (x-axis) "Knowledge" >> (or "skill" or ). > > You can assume all you want, but no serious person processing numbers > would choose axes like

Re: Support for new items in set type

2007-04-22 Thread Prateek
> > 2) Maintaining a copy wastes memory > > 3) I don't have a good solution if I delete items from the set > > (calculating the difference will return an empty set but I need to > > actually delete stuff). > > (3) is easy -- the difference originalset-finalset is the set of things > you have to de

Re: Select weirdness

2007-04-22 Thread Irmen de Jong
Ron Garret wrote: > Here's my code. It's a teeny weeny little HTTP server. (I'm not really > trying to reinvent the wheel here. What I'm really doing is writing a > dispatching proxy server, but this is the shortest way to illustrate the > problem I'm having): > > from SocketServer import *

Dictionaries and dot notation

2007-04-22 Thread Martin Drautzburg
This may be pretty obvious for most of you: When I have an object (an instance of a class "Foo") I can access attributes via dot notation: aFoo.bar however when I have a dictionary aDict = {"bar":"something"} I have to write aDict["bar"] What if I want to create a da

Re: sql to xml

2007-04-22 Thread Martin Drautzburg
Tim Golden wrote: > 2) Don't use XML if you don't need to. I would call this advice a "golden rule" the violation of which has caused serious pain in some of the projects I am working on. -- http://mail.python.org/mailman/listinfo/python-list

Re: favourite IDE

2007-04-22 Thread Martin Drautzburg
azrael wrote: > Some time ago I posted a question about the favourite IDE. I finally > found it. WING IDE i the best I've ever seen for python. Yes WingIde is cool but it is not free. A fairly good alternative is the "pydev" plugin for eclipse. -- http://mail.python.org/mailman/listinfo/python-

serializable object references

2007-04-22 Thread Martin Drautzburg
Is it possible to convert an object into a string that identifies the object in a way, so it can later be looked up by this string. Technically this should be possible, because things like <__main__.Foo instance at 0xb7cfb6ac> say everything about an object. But how can I look up the real object

Re: Can __init__ not return an object?

2007-04-22 Thread Arnaud Delobelle
On Apr 22, 3:36 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > When I go to create an object I want to be able to decide whether the > object is valid or not in __init__, and if not, I want the constructor to > return something other than an object, (like maybe None). [...] __init__ doesn't crea

Re: Access to file dropped on .exe/.app icon

2007-04-22 Thread Kamy . Iltcheva
On Apr 22, 1:41 pm, Martin <[EMAIL PROTECTED]> wrote: > If i create an app using py2exe/py2app is there then a way on windows/ > mac to get access to a file dragged and dropped on to the .exe/.app > icon? > > Martin Windows: import sys print sys.argv[1:] -- http://mail.python.org/mailman/listinf

Vector classes

2007-04-22 Thread Mizipzor
During my coding Ive found two vector classes on the internet. Ive modified them both a little but the do both have advantages and disadvantages. vector1: http://rafb.net/p/4FVdh699.html vector2: http://rafb.net/p/0KShGu30.html With 1, I can typ vec.x and vec.y, very nice. With 2, I need to do ve

Re: serializable object references

2007-04-22 Thread 7stud
Martin Drautzburg wrote: > Is it possible to convert an object into a string that identifies the > object in a way, so it can later be looked up by this string. > Technically this should be possible, because things like > > <__main__.Foo instance at 0xb7cfb6ac> > > say everything about an object.

Re: python cgi problem with textarea

2007-04-22 Thread placid
On Apr 22, 4:08 pm, Adrian Smith <[EMAIL PROTECTED]> wrote: > This may be more a cgi thing than a Python one, but I'm trying to get > this page: > > http://adrian10.phpwebhosting.com/trial.html > > consisting basically of this: > > > > > > > ...to print out the contents of the textarea with thi

Re: Dictionaries and dot notation

2007-04-22 Thread Stefan Behnel
Martin Drautzburg wrote: > This may be pretty obvious for most of you: > > When I have an object (an instance of a class "Foo") I can access > attributes via dot notation: > > aFoo.bar > > however when I have a dictionary > > aDict = {"bar":"something"} > > I have to write >

Re: Select weirdness

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > > The only difference I can discern is that the browser send \r\n > > for end-of-line while telnet just sends \n. ... > > But I don't see why that should make any difference. > > Easy. If you only accept "\r\n

function minimization

2007-04-22 Thread [EMAIL PROTECTED]
Is anyone aware of python library that does function minimization a la Minuit (http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/) used by CERN? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: No speedup on multi-processor machine?

2007-04-22 Thread Fuzzyman
On Apr 22, 1:03 am, Neil Hodgson <[EMAIL PROTECTED]> wrote: > Fuzzyman: > > > IronPython is *definitely* not restricted by the GIL. > > IronPython is currently mostly slower than CPython although the > particular problem should be tested to see if IronPython helps. > > Some recent benchmark

Re: Access to file dropped on .exe/.app icon

2007-04-22 Thread EuGeNe Van den Bulke
Martin wrote: > If i create an app using py2exe/py2app is there then a way on windows/ > mac to get access to a file dragged and dropped on to the .exe/.app > icon? > > Martin > I did something like that for a small program I wrote to learn more about Python Programming on Windows ... check it

Re: serializable object references

2007-04-22 Thread Gabriel Genellina
En Sun, 22 Apr 2007 08:07:27 -0300, Martin Drautzburg <[EMAIL PROTECTED]> escribió: > Is it possible to convert an object into a string that identifies the > object in a way, so it can later be looked up by this string. > Technically this should be possible, because things like > > <__main__.Foo

Re: Dictionaries and dot notation

2007-04-22 Thread Daniel Nogradi
> > This may be pretty obvious for most of you: > > > > When I have an object (an instance of a class "Foo") I can access > > attributes via dot notation: > > > > aFoo.bar > > > > however when I have a dictionary > > > > aDict = {"bar":"something"} > > > > I have to write > > > >

Re: Vector classes

2007-04-22 Thread Mark Dickinson
On Apr 22, 8:33 am, Mizipzor <[EMAIL PROTECTED]> wrote: > With 1, I can typ vec.x and vec.y, very nice. With 2, I need to do > vec.vals[0] and vec.vals[1], which makes my eyes bleed. If you add a __getitem__ method to the second vector class: def __getitem__(self, i): retu

Re: python cgi problem with textarea

2007-04-22 Thread Adrian Smith
On Apr 22, 11:40 pm, Jim <[EMAIL PROTECTED]> wrote: > On Apr 22, 2:08 am, Adrian Smith <[EMAIL PROTECTED]> wrote:> ...and I > > get an internal server error if I have any spaces in the textarea, > > And what error appears in the server error log? I've just asked my web provider why I don't appear

Re: Dictionaries and dot notation

2007-04-22 Thread Daniel Nogradi
> > This may be pretty obvious for most of you: > > > > When I have an object (an instance of a class "Foo") I can access > > attributes via dot notation: > > > > aFoo.bar > > > > however when I have a dictionary > > > > aDict = {"bar":"something"} > > > > I have to write > > > >

Re: function minimization

2007-04-22 Thread attn . steven . kuo
On Apr 22, 6:55 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Is anyone aware of python library that does function minimization a la > Minuit (http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/) used by CERN? > > thanks If you have a C complier and the lapack, blas, and levmar libraries, you cou

Re: serializable object references

2007-04-22 Thread 7stud
On Apr 22, 5:07 am, Martin Drautzburg <[EMAIL PROTECTED]> wrote: > > <__main__.Foo instance at 0xb7cfb6ac> > > But how can I look up the real object, > when I only have this string? > You can't because that identifies the instance with an address, and pointers are not part of the python language.

Re: Python "robots.txt" parser broken since 2003

2007-04-22 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: > This bug, "[ 813986 ] robotparser interactively prompts for username and > password", has been open since 2003. It killed a big batch job of ours > last night. > > Module "robotparser" naively uses "urlopen" to read "robot

Re: Dictionaries and dot notation

2007-04-22 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : > Martin Drautzburg a écrit : > >> This may be pretty obvious for most of you: >> >> When I have an object (an instance of a class "Foo") I can access >> attributes via dot notation: >> >> aFoo.bar >> >> however when I have a dictionary >> aDict = {"ba

Re: python cgi problem with textarea

2007-04-22 Thread Jim
On Apr 22, 2:08 am, Adrian Smith <[EMAIL PROTECTED]> wrote: > ...and I get an internal server error if I have any spaces in the > textarea, And what error appears in the server error log? -- http://mail.python.org/mailman/listinfo/python-list

Re: serializable object references

2007-04-22 Thread Martin Drautzburg
Gabriel Genellina wrote: > En Sun, 22 Apr 2007 08:07:27 -0300, Martin Drautzburg > <[EMAIL PROTECTED]> escribió: > >> Is it possible to convert an object into a string that identifies the >> object in a way, so it can later be looked up by this string. >> Technically this should be possible, beca

Re: Dictionaries and dot notation

2007-04-22 Thread Bruno Desthuilliers
Martin Drautzburg a écrit : > This may be pretty obvious for most of you: > > When I have an object (an instance of a class "Foo") I can access > attributes via dot notation: > > aFoo.bar > > however when I have a dictionary > > aDict = {"bar":"something"} > > I have to write

Re: Support for new items in set type

2007-04-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Prateek <[EMAIL PROTECTED]> wrote: > >Thanks Alex, but we're actually implementing a (non-relational) >database engine. Why are you reinventing the wheel? Why not just implement your functionality on top of an existing database as your backing store? -- Aahz ([E

Re: python cgi problem with textarea

2007-04-22 Thread Adrian Smith
On Apr 22, 10:09 pm, placid <[EMAIL PROTECTED]> wrote: > i just tried it and its working. here it is > > http://yallara.cs.rmit.edu.au/~bevcimen/form.html > > maybe the internal server error is because mod_python isn't installed > assuming your using Apache as your web server Yeah, but it wouldn'

Re: No speedup on multi-processor machine?

2007-04-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: >Caleb Hattingh wrote: >> On Apr 21, 11:02 pm, [EMAIL PROTECTED] wrote: >> >>>Hi, >>>I am using Python Thread library for my parallel processing course >>>project. I am doing matrix convolution on a multi-processor machine >>>r

Re: Flat DB seeking speed

2007-04-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Jia Lu <[EMAIL PROTECTED]> wrote: > > I see there are lots of flat db or db-like modules in the standard >python modules. > What about the keywords seeking speed of them ? > > (I want to put about 1 articles with 1 IDs, and I can do >searching keywords with

file.read() returns an emtpy even if its currenet position is not at the end

2007-04-22 Thread js
Hi list. I'm writing a tail -f like program in python and I found file.read() doesn't work as I think it should. Here's the code illustrating my problem. ### #!/usr/bin/env python import os, sys filename = "test.out" f = open(filename, "w+") f.write("Hello") f.flush() f.seek(0, 2) statinfo =

Re: Python "robots.txt" parser broken since 2003

2007-04-22 Thread Steven Bethard
John Nagle wrote: > Terry Reedy wrote: >> "John Nagle" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> | This was reported in 2003, and a patch was uploaded in 2005, but the >> patch >> | never made it into Python 2.4 or 2.5. >> >> If the patch is still open, perhaps you could r

Re: No speedup on multi-processor machine?

2007-04-22 Thread Stefan Behnel
[EMAIL PROTECTED] schrieb: > Thanks guys. But I think IronPython only works on Windows machine, but > I am using a Sun machine. Isn't there a mono port for Sun? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: function minimization

2007-04-22 Thread [EMAIL PROTECTED]
On Apr 22, 9:55 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: In the meantime, I found mpfit, but this is not working with python2.5. Any advice? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: serializable object references

2007-04-22 Thread Daniel Nogradi
> Is it possible to convert an object into a string that identifies the > object in a way, so it can later be looked up by this string. > Technically this should be possible, because things like > > <__main__.Foo instance at 0xb7cfb6ac> > > say everything about an object. But how can I look up the

Re: Select weirdness

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > Here's my code. It's a teeny weeny little HTTP server. (I'm not really > > trying to reinvent the wheel here. What I'm really doing is writing a > > dispatching proxy server, but this is the shor

Re: No speedup on multi-processor machine?

2007-04-22 Thread danfan1981
Thanks guys. But I think IronPython only works on Windows machine, but I am using a Sun machine. I was suggested to use Jython, which can run on Sun. But I need to use Numpy for matrix operations, which is only available to CPython. -- http://mail.python.org/mailman/listinfo/python-list

Convert from/to struct_time

2007-04-22 Thread Florian Lindner
Hello, I have a struct_time and a datetime object and need compare them. Is there any function that converts either of these two to another? Thanks, Florian -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert from/to struct_time

2007-04-22 Thread Diez B. Roggisch
Florian Lindner schrieb: > Hello, > I have a struct_time and a datetime object and need compare them. Is there > any function that converts either of these two to another? datetime.datetime(*time.localtime()[:6]) Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Select weirdness

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Ron Garret <[EMAIL PROTECTED]> wrote: > Here's my code. It's a teeny weeny little HTTP server. (I'm not really > trying to reinvent the wheel here. What I'm really doing is writing a > dispatching proxy server, but this is the shortest way to illustrate the >

Re: Dictionaries and dot notation

2007-04-22 Thread Martin Drautzburg
> mydata = data( ) > mydata.foo = 'foo' > mydata.bar = 'bar' > > print mydata.foo > print mydata.bar I am aware of all this. Okay let me rephrase my question: is there a way of using dot notation without having to create a class? -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespaces/introspection: collecting sql strings for validation

2007-04-22 Thread Martin Drautzburg
Peter Otten wrote: > Martin Drautzburg wrote: > >> I would like to validate sql strings, which are spread all over the >> code, i.e. I run ("prepare") them against a database to see if it >> happy with the statements. Spelling errors in sql have been a major >> pain for me. > > def validateSQL(

*** Dr G Polya BRILLIANTLY analyses the Virgina Shooting Incident ***

2007-04-22 Thread thermate
Dr Gideon Polya published some 130 works in a 4 decade scientific career, most recently a huge pharmacological reference text "Biochemical Targets of Plant Bioactive Compounds" (Taylor & Francis, New York & London, 2003), and is currently editing a completed book on global avoidable mortality (nume

pickled object, read and write..

2007-04-22 Thread [EMAIL PROTECTED]
Hi all. I have to put together some code that reads high scores from a saved file, then gives the user the opportunity to add their name and score to the high scores list, which is then saved. Trouble is, I can't tell the program to read a file that doesn't exist, that generates an error. So I m

Re: Select weirdness

2007-04-22 Thread Ron Garret
I think I've figured out what's going on. First, here's the smoking gun: I changed the code as follows: class myHandler(StreamRequestHandler): def handle(self): print '>>>' while 1: sl = select([self.rfile],[],[],1)[0] print sl l = self.rfile.readline() i

Re: *** Dr G Polya BRILLIANTLY analyses the Virgina Shooting Incident ***

2007-04-22 Thread Jim Thompson
Ignorant Bastard Poster On 22 Apr 2007 11:32:34 -0700, [EMAIL PROTECTED] wrote: >Dr Gideon Polya published some 130 works in a 4 decade scientific >career, most recently a huge pharmacological reference text >"Biochemical Targets of Plant Bioactive Compounds" (Taylor & Francis, >New York & London

recursion depth problem

2007-04-22 Thread proctor
hello, i have a small function which mimics binary counting. it runs fine as long as the input is not too long, but if i give it input longer than 8 characters it gives RuntimeError: maximum recursion depth exceeded in cmp i'm not too sure what i am doing improperly. is there really a lot of r

sharon stone paris hilton

2007-04-22 Thread S S
sharon stone paris hilton www.alphasearch.at www.alphasearch.be www.alphasearch.it www.alphasearch.info www.alphasearch.gr www.alphasearch.es www.alphasearch.se www.alphasearch.dk -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespaces/introspection: collecting sql strings for validation

2007-04-22 Thread Scott David Daniels
Martin Drautzburg wrote: > I would like to validate sql strings, which are spread all over the > code, The statements will not be assembled from smaller pieces, > but they will not neccessarily be defined at module level. I could > live with class level, > parse the source file, but I am

Re: recursion depth problem

2007-04-22 Thread Michael Bentley
On Apr 22, 2007, at 1:49 PM, proctor wrote: > i have a small function which mimics binary counting. it runs fine as > long as the input is not too long, but if i give it input longer than > 8 characters it gives > > RuntimeError: maximum recursion depth exceeded in cmp > > i'm not too sure what

python style guide inconsistencies

2007-04-22 Thread Darren Dale
I was just searching for some guidance on how to name packages and modules, and discovered some inconsistencies on the www.python.org. http://www.python.org/doc/essays/styleguide.html says "Module names can be either MixedCase or lowercase." That page also refers to PEP 8 at http://www.python.org/d

Re: Dictionaries and dot notation

2007-04-22 Thread Martin Drautzburg
Daniel Nogradi wrote: >> > What if I want to create a datastructure that can be used in dot >> > notation without having to create a class, i.e. because those >> > objects have no behavior at all? >> >> A class inheriting from dict and implementing __getattr__ and >> __setattr__ should do the tri

Re: Select weirdness

2007-04-22 Thread Jean-Paul Calderone
On Sun, 22 Apr 2007 11:42:10 -0700, Ron Garret <[EMAIL PROTECTED]> wrote: >I think I've figured out what's going on. > > [snip] > >As you can see, the select call shows input available for a while (five >lines) and then shows no input available despite the fact that there is >manifestly still input

[ANN] Pythonutils 0.3.0

2007-04-22 Thread Fuzzyman
There is a new (and long overdue) release of the `Pythonutils module `_. This is version **0.3.0**. * `Quick Download: Pythonutils 0.3.0.zip `_ What

Re: Python's handling of unicode surrogates

2007-04-22 Thread Leo Kislov
On Apr 20, 7:34 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Apr 20, 6:21 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > If you absolutely think support for non-BMP characters is necessary > > in every program, suggesting that Python use UCS-4 by default on > > all systems has a higher c

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 1:24 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 22, 2007, at 1:49 PM, proctor wrote: > > > > > i have a small function which mimics binary counting. it runs fine as > > long as the input is not too long, but if i give it input longer than > > 8 characters it gives > > > Run

Re: Vector classes

2007-04-22 Thread Will McGugan
Mizipzor wrote: > During my coding Ive found two vector classes on the internet. Ive > modified them both a little but the do both have advantages and > disadvantages. > I'm working on a vector class at the moment, in my 'gameobjects' library. It's not really ready for public consumption, but fee

Re: python style guide inconsistencies

2007-04-22 Thread Martin v. Löwis
Darren Dale schrieb: > I was just searching for some guidance on how to name packages and modules, > and discovered some inconsistencies on the www.python.org. > http://www.python.org/doc/essays/styleguide.html says "Module names can be > either MixedCase or lowercase." That page also refers to PEP

Re: recursion depth problem

2007-04-22 Thread Steven Bethard
proctor wrote: > On Apr 22, 1:24 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> On Apr 22, 2007, at 1:49 PM, proctor wrote: >> >> >> >>> i have a small function which mimics binary counting. it runs fine as >>> long as the input is not too long, but if i give it input longer than >>> 8 characte

Re: pickled object, read and write..

2007-04-22 Thread phreaki
On Apr 22, 2:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all. > > I have to put together some code that reads high scores from a saved > file, then gives the user the opportunity to add their name and score > to the high scores list, which is then saved. > > Trouble is, I can't tell

Re: pickled object, read and write..

2007-04-22 Thread hg
[EMAIL PROTECTED] wrote: > Hi all. > > I have to put together some code that reads high scores from a saved > file, then gives the user the opportunity to add their name and score > to the high scores list, which is then saved. > > Trouble is, I can't tell the program to read a file that doesn't

Re: Python's handling of unicode surrogates

2007-04-22 Thread Ross Ridge
Rhamphoryncus <[EMAIL PROTECTED]> wrote: >I wish to write software that supports Unicode. Like it or not, >Unicode goes beyond the BMP, so I'd be lying if I said I supported >Unicode if I only handled the BMP. The Unicode standard doesn't require that you support surrogates, or any other kind of

Re: Vector classes

2007-04-22 Thread Erik Max Francis
Mizipzor wrote: > During my coding Ive found two vector classes on the internet. Ive > modified them both a little but the do both have advantages and > disadvantages. > > vector1: http://rafb.net/p/4FVdh699.html > vector2: http://rafb.net/p/0KShGu30.html > > With 1, I can typ vec.x and vec.y, v

Re: recursion depth problem

2007-04-22 Thread half . italian
On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: > hello, > > i have a small function which mimics binary counting. it runs fine as > long as the input is not too long, but if i give it input longer than > 8 characters it gives > > RuntimeError: maximum recursion depth exceeded in cmp > > i

Bug in select (was: Re: Select weirdness)

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Ron Garret <[EMAIL PROTECTED]> wrote: > The answer is obvious: select is looking only at the underlying socket, > and not at the rfile buffers. Here is conclusive proof that there's a bug in select: from socket import * from select import select s=socket(AF_INET

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: > On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: > > > > > hello, > > > i have a small function which mimics binary counting. it runs fine as > > long as the input is not too long, but if i give it input longer than > > 8 characters it gives >

Re: function minimization

2007-04-22 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Is anyone aware of python library that does function minimization a la | Minuit (http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/) used by CERN? Have you checked the minimization function in scipy? -- http://mail.python.org/mailman/li

Re: Python "robots.txt" parser broken since 2003

2007-04-22 Thread John Nagle
Steven Bethard wrote: > John Nagle wrote: > >> Terry Reedy wrote: >> >>> "John Nagle" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>> | This was reported in 2003, and a patch was uploaded in 2005, but >>> the patch >>> | never made it into Python 2.4 or 2.5. >>> >>> If the pa

Re: Bug in select

2007-04-22 Thread Erik Max Francis
Ron Garret wrote: > So this is clearly a bug, but surely I'm not the first person to have > encountered this? Is there a known workaround? It's hard to see how this demonstrates a bug in anything, since you're telnetting to the wrong port in your example. -- Erik Max Francis && [EMAIL PROTEC

Re: python style guide inconsistencies

2007-04-22 Thread Terry Reedy
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Darren Dale schrieb: | > I was just searching for some guidance on how to name packages and modules, | > and discovered some inconsistencies on the www.python.org. | > http://www.python.org/doc/essays/styleguide.ht

Re: Bug in select

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > > So this is clearly a bug, but surely I'm not the first person to have > > encountered this? Is there a known workaround? > > It's hard to see how this demonstrates a bug in anything, since yo

[re.finditer] Getting all occurences in one go?

2007-04-22 Thread Gilles Ganault
Hello I'd like to make sure there isn't an easier way to extract all the occurences found with re.finditer: === req = urllib2.Request(url, None, headers) response = urllib2.urlopen(req).read() matches = re.compile("(\d+).html").finditer(response) # --- BEGIN for match

Re: [re.finditer] Getting all occurences in one go?

2007-04-22 Thread Gilles Ganault
On Sun, 22 Apr 2007 23:28:23 +0200, Gilles Ganault <[EMAIL PROTECTED]> wrote: >I'd like to make sure there isn't an easier way to extract all the >occurences found with re.finditer: Oops, s/match/item/: req = urllib2.Request(url, None, headers) response = urllib2.urlopen(req).read() matches = re.

Re: python style guide inconsistencies

2007-04-22 Thread Bjoern Schliessmann
Darren Dale wrote: > I was just searching for some guidance on how to name packages and > modules, and discovered some inconsistencies on the > www.python.org. http://www.python.org/doc/essays/styleguide.html > says "Module names can be either MixedCase or lowercase." That > page also refers to PE

Re: file.read() returns an emtpy even if its currenet position is not at the end

2007-04-22 Thread Alberto Valverde
On Apr 22, 6:51 pm, "js " <[EMAIL PROTECTED]> wrote: > Hi list. > > I'm writing a tail -f like program in python > and I found file.read() doesn't work as I think it should. > > Here's the code illustrating my problem. > > ### > #!/usr/bin/env python > import os, sys > filename = "test.out" > > f =

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 2:06 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > proctor wrote: > > On Apr 22, 1:24 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > >> On Apr 22, 2007, at 1:49 PM, proctor wrote: > > >>> i have a small function which mimics binary counting. it runs fine as > >>> long as the input i

Re: python cgi problem with textarea

2007-04-22 Thread Graham Dumpleton
On Apr 22, 11:09 pm, placid <[EMAIL PROTECTED]> wrote: > On Apr 22, 4:08 pm, Adrian Smith <[EMAIL PROTECTED]> wrote: > > > > > This may be more a cgi thing than a Python one, but I'm trying to get > > this page: > > >http://adrian10.phpwebhosting.com/trial.html > > > consisting basically of this: >

Re: Building browser-like GET request

2007-04-22 Thread Steve Holden
Björn Keil wrote: [...] > > I hope that helped and I wasn't telling things you already new. > As a sidenote: For the task you describe I'd rather use an actual > sniffer - such as Wireshark (http://en.wikipedia.org/wiki/Wireshark), > than logs of a Proxy... Not sure wether Wireshark works under Wi

Re: Bug in select

2007-04-22 Thread Erik Max Francis
Ron Garret wrote: > Geez you people are picky. Since I ran this several times I ran into > the TIM_WAIT problem. Here's the actual transcript: It's not about being picky, it's about making it clear what your problem is. You're now describing an entirely different problem, hence why it's imp

Re: [re.finditer] Getting all occurences in one go?

2007-04-22 Thread Paul Rubin
Gilles Ganault <[EMAIL PROTECTED]> writes: > for match in matches: > if mytable[item]=="": > mytable[item]= match.group(1) > else: > mytable[item]= mytable[item] + "," + match.group(1) # > --- END > === > > Can the lines between B

Re: Vector classes

2007-04-22 Thread Gabriel Genellina
En Sun, 22 Apr 2007 09:33:53 -0300, Mizipzor <[EMAIL PROTECTED]> escribió: > During my coding Ive found two vector classes on the internet. Ive > modified them both a little but the do both have advantages and > disadvantages. > > vector1: http://rafb.net/p/4FVdh699.html > vector2: http://rafb.net

Re: recursion depth problem

2007-04-22 Thread Michael Bentley
On Apr 22, 2007, at 4:08 PM, proctor wrote: > On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: >> On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: >> >> >> >>> hello, >> >>> i have a small function which mimics binary counting. it runs >>> fine as >>> long as the input is not too long, but

Re: Bug in select

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > > Geez you people are picky. Since I ran this several times I ran into > > the TIM_WAIT problem. Here's the actual transcript: > > It's not about being picky, it's about making it clear what y

Re: recursion depth problem

2007-04-22 Thread proctor
On Apr 22, 4:37 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 22, 2007, at 4:08 PM, proctor wrote: > > > > > On Apr 22, 2:55 pm, [EMAIL PROTECTED] wrote: > >> On Apr 22, 11:49 am, proctor <[EMAIL PROTECTED]> wrote: > > >>> hello, > > >>> i have a small function which mimics binary countin

Re: Bug in select (was: Re: Select weirdness)

2007-04-22 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > Well, on WinXP, Python 2.4, with I should have specified: I'm running 2.5 on unix. (I've reproduced the problem on both Linux and OS X.) rg -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespaces/introspection: collecting sql strings for validation

2007-04-22 Thread George Sakkis
On Apr 21, 4:16 pm, Martin Drautzburg <[EMAIL PROTECTED]> wrote: > I would like to validate sql strings, which are spread all over the > code, i.e. I run ("prepare") them against a database to see if it happy > with the statements. Spelling errors in sql have been a major pain for > me. > > The sta

  1   2   >