Running twisted http server - "Method Not Allowed" error

2005-05-30 Thread qwejohn
Hello, I had posted this question in the twisted mailing list but did not got a solution ; I hope that the python Gurus of this forum can help me a bit. I am trying the exmaple in the python docs - http://twistedmatrix.com/users/warner/doc-latest/web/howto/using-twistedweb.xhtml Configuring a

[ANN] IPython 0.6.14.

2005-05-30 Thread Fernando Perez
Hi all, I've just made the 0.6.14 release of IPython, mostly to fix the inevitable bugs reported after the .13 one (though one big improvement sneaked by). IPython's homepage is at: http://ipython.scipy.org and downloads are at: http://ipython.scipy.org/dist I've provided RPMs (for Python 2.3

Re: struct unpack newline

2005-05-30 Thread grant
Hi , Thanks for the tip regarding checking the length of line. I discovered that on the problem record it was short by a few bytes. After changing the read method from "for line in.." to "infile.read(n)" my problem was solved, what concerns me though is that although the file is opened in binary m

Newbie Here

2005-05-30 Thread Mark Sargent
Hi All, I'm taking the plunge into Python. I'm currently following this tutorial, http://docs.python.org/tut/ I am not a programmer in general, although I've learnt a bit of bash scripting and some php/asp. I want to get into python to use it for Linux/Unix related stuff. A question I have, is,

pickle alternative

2005-05-30 Thread simonwittber
I've written a simple module which serializes these python types: IntType, TupleType, StringType, FloatType, LongType, ListType, DictType It available for perusal here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/415503 It appears to work faster than pickle, however, the decode proc

Questions on using Qt or wxWindows with Python and OS X

2005-05-30 Thread Kenneth McDonald
If this is not an appropriate newsgroup for this type of posting, please let me know and (if possible) suggest an alternative. I've done a fair bit of research on the net, but information is scattered all over the place and I haven't been able to find mailing lists relating specifically to python a

Re: eric3 question

2005-05-30 Thread F. Petitjean
Le Tue, 31 May 2005 03:13:31 +0400, Alexander Zatvornitskiy a écrit : > Hello All! > > I'am using eric3 IDE under win32 (snapshot 2005-04-10), and have a trouble. I > use this code: > print "enter q to quit, or smthing else to continue" > while not sys.stdin.readline()=="q": > smth

Re: eric3 question

2005-05-30 Thread Gerrit van Dyk
Alexander Zatvornitskiy wrote: > Hello All! > > I'am using eric3 IDE under win32 (snapshot 2005-04-10), and have a trouble. I > use this code: > print "enter q to quit, or smthing else to continue" > while not sys.stdin.readline()=="q": > smthing(else) > Try using raw_input() ins

Report generator for object databases.

2005-05-30 Thread Mir Nazim
Hi, I m planning to use ZODB for an applicaton. Is any one aware of report generators like Data Vision, Crystal Reports, fo python object databases. Some of you may have faced/solved similar problem some where. Help appreciated. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Just remember that Python is sexy

2005-05-30 Thread Eric Pederson
> I often can't remember that to remove spaces from a string whether it's > strip() or trim(), and when finding patterns with the re library > whether it's find() or search() and when iterating over key, values of > a dictionary whether it's items() or entries(). > But then I remember that Python i

Re: prime number

2005-05-30 Thread Dale Hagglund
Sigh ... one of my intermediate versions of is_prime() returns True if the n is *not* prime, and false otherwise. The final version is correct, though. Dale. -- http://mail.python.org/mailman/listinfo/python-list

Re: prime number

2005-05-30 Thread Dale Hagglund
lostinpython> I'm having trouble writing a program that figures lostinpython> out a prime number. Does anyone have an idea on how lostinpython> to write it? [I can't quite tell from your posts what your level of programming knowledge is, so I've aimed low. If this was wrong, please

Re: finding indices in a sequence of parentheses

2005-05-30 Thread Steven Bethard
Raymond Hettinger wrote: > [Steven Bethard] > >>>I have a list of strings that looks something like: >>>lst = ['0', '0', '(*)', 'O', '(*', '*', '(*', '*))', '((*', '*)', '*)'] > > . . . > >>>I want the indices: >>>(2, 2), (4, 7), (6, 7), (8, 9) and (8, 10) > > opener_stack = [] > for i, elem i

a newbie question about debug

2005-05-30 Thread flyaflya
I use pdb.set_trace() to debug code.the Debugger Commands "enable" and "disable" need argumet -- "breakpoint number",but I can't find any information about it,so how to can i get the breakpoint number? I think "disable","enable" are very useful commands... -- http://mail.python.org/mailman/lis

wxTextCtrl problem

2005-05-30 Thread austin
I produced 5 wxTextCtrl. My program is to let the user enter the serial number. Each wxTextCtrl has 4 maxlength. My ideal is if the user enter 4 digits on first wxTextCtrl, and the program will move the cursor to the second wxTextCtrl. I checked the wxTextCtrl::SetInsertingPoint. But this function

Re: Finite Element Solver for Python?

2005-05-30 Thread Robert Kern
Hsuan-Yeh Chang wrote: > Dear All, > > Anyone knows a good Finite Element Solver for python programer? google("finite element python") -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http:/

Finite Element Solver for Python?

2005-05-30 Thread Hsuan-Yeh Chang
Dear All, Anyone knows a good Finite Element Solver for python programer? Thanks! HYC -- http://mail.python.org/mailman/listinfo/python-list

Re: how to prepend string to a string?

2005-05-30 Thread Kent Johnson
flamesrock wrote: > so I know you can append a string. But how do you *prepend* a string, > as shown in the following code > > #dirList = ['depth1','depth2','depth3'] > #string = """position""" > #for x in len(dirList): > # string += '>> %s'%dirList.pop()#() > # > > to return >

ANN: wxPython 2.6.0.1

2005-05-30 Thread Robin Dunn
Announcing -- I'm pleased to announce the 2.6.0.1 release of wxPython, now available for download at http://wxpython.org/download.php. This release consists mostly of bug fixes made since the 2.6.0.0 release a month ago. What is wxPython? - wxPython is a GUI toolkit for

Re: how to prepend string to a string?

2005-05-30 Thread Peter Hansen
flamesrock wrote: > so I know you can append a string. But how do you *prepend* a string, > as shown in the following code > > #dirList = ['depth1','depth2','depth3'] > #string = """position""" > #for x in len(dirList): > # string += '>> %s'%dirList.pop()#() There's not _really_

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Peter Hansen
Benji York wrote: > Roel Schroeven wrote: > > You haven't looked very well though: there are actually quite a lot > > of extra spaces. Still, it's nicely done indeed. > > Hmm. I only saw doubled spaces after commas and periods. That's > fairly standard practice, for the periods at least. I do

Re: How to run functions in the background?

2005-05-30 Thread Benji York
Ognjen Bezanov wrote: > Is there anywhere where I can find out about queues, for people who know > python but have not had a lot of experience with threaded programs? Cheers FOLDOC to the rescue: http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?queue -- Benji York -- http://mail.python.org/mailman/li

Re: How to run functions in the background?

2005-05-30 Thread Ognjen Bezanov
Terry Reedy wrote: >"Ognjen Bezanov" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] > > >>I need to find a way to 'fork' a function into the background yet still >>be able to send commands to it. >> >> > >Others gave you the answer to this.. > > > >>I am writing a media play

Re: how to prepend string to a string?

2005-05-30 Thread Benji York
flamesrock wrote: > so I know you can append a string. But how do you *prepend* a string, > as shown in the following code > > #dirList = ['depth1','depth2','depth3'] > #string = """position""" > #for x in len(dirList): > # string += '>> %s'%dirList.pop()#() > # How about string

eric3 question

2005-05-30 Thread Alexander Zatvornitskiy
Hello All! I'am using eric3 IDE under win32 (snapshot 2005-04-10), and have a trouble. I use this code: print "enter q to quit, or smthing else to continue" while not sys.stdin.readline()=="q": smthing(else) I can't run this code to debug in eric3. The questions are - how to fix i

how to prepend string to a string?

2005-05-30 Thread flamesrock
so I know you can append a string. But how do you *prepend* a string, as shown in the following code #dirList = ['depth1','depth2','depth3'] #string = """position""" #for x in len(dirList): # string += '>> %s'%dirList.pop()#() # to return position>> depth1 >> depth2 >> depth3 r

Re: Checking for a full house

2005-05-30 Thread mwdsmith
Wow... This is amazing, I didn't know there were so many way's of doing this! Thank you every one for all your suggestions. I particularly like the sorting counting ones. And no, Roy, this isn't a home work assignment, at the moment all of those contain php and java RMI. :) -- http://mail.p

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Benji York
Roel Schroeven wrote: > You haven't looked very well though: there are actually quite a lot > of extra spaces. Still, it's nicely done indeed. Hmm. I only saw doubled spaces after commas and periods. That's fairly standard practice, for the periods at least. I don't know if people regularly p

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Arthur
On Mon, 30 May 2005 14:24:54 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >"D H" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Elliot Temple wrote: >>> Hi I have two questions. Could someone explain to me why Python is >>> case sensitive? I find that annoying. >> >> I do to

Re: Exiting SocketServer: socket.error: (98, 'Address already in use')

2005-05-30 Thread Andrew Dalke
Magnus Lyckå wrote: > Why doesn't my socket > get released by the OS when I exit via my handle_error? Hi Magnus, I wrote about this at http://www.dalkescientific.com/writings/diary/archive/2005/04/21/using_xmlrpc.html The reason for it is described at http://hea-www.harvard.edu/~fine/Tech/ad

Re: plotting with Python

2005-05-30 Thread [EMAIL PROTECTED]
We use dislin in my lab. I don't think it's GPL... http://www.linmpi.mpg.de/dislin -- http://mail.python.org/mailman/listinfo/python-list

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Fraca7
On Mon, 30 May 2005 20:56:22 +, Roel Schroeven wrote: > You haven't looked very well though: there are actually quite a lot of > extra spaces. Still, it's nicely done indeed. C-u M-q ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode Congruence

2005-05-30 Thread John Machin
phil top-posted > Thanks. > I did search that site but, wow, huge. Searched how 1. If you use their own search box, the first hit is U+2A6D CONGRUENT WITH DOT ABOVE The U2A00.pdf entry for U+2A6D does refer back to U+2245 2. The "where is my character" page also says: "You can also do a t

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Roel Schroeven
Benji York wrote: > What I want to know is how Mangus wrote an entire message fully > justified. I looked for extra spaces and other cheats but only > found a couple of superfluous exclamation marks. Well done! He > must be a justification wizard. I wish I could do that too. :) I hadn't even

Re: How do you drive-by-wire a car using Python ?

2005-05-30 Thread Tim Churches
[EMAIL PROTECTED] wrote: > Hello everybody, > > Our entry in the DARPA Grand Challenge race uses Python as a > programming language. For those of you who are interested, we are > beginning to put some of our code on our blog. Here is a shot of a Pythonic DARPA Grand Challenge autonomous vehicle p

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Benji York
What I want to know is how Mangus wrote an entire message fully justified. I looked for extra spaces and other cheats but only found a couple of superfluous exclamation marks. Well done! He must be a justification wizard. I wish I could do that too. :) -- Benji York -- http://mail.python.org/ma

Re: Unicode Congruence

2005-05-30 Thread phil
Thanks. I did search that site but, wow, huge. That page had no reference to congruence and the pdf did not contain the pattern congru. But I'll have some better ideas how to search next time. thanx I used \u2245 btw John Machin wrote: > phil wrote: > >>I can't find, >> > > Having looked where?

(", ) Print This! Press [Ctrl][P] Keys To Print... >> http://www.phpbbserver.com/phpbb/viewtopic.php?t=2&mforum=anysubjectchat < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < <

2005-05-30 Thread compaq71127
(",) Print This! Press [Ctrl][P] Keys To Print... >> http://www.phpbbserver.com/phpbb/viewtopic.php?t=2&mforum=anysubjectchat < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < <

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Magnus Lycka
Terry Reedy wrote: > Difference annoyances for different folks, I guess. IN MY EXPERIENCE, MANY PEOPLE ON THE INTERNET ARE ANNOYED BY PEOPLE WHO DON'T USE CASE THE WAY THEY ARE EXPECTED. IT ALSO SEEMS TO ME THAT LOWER CASE TEXT IS OFTEN MORE EASY TO READ, AND ALSO THAT IT IS EASIER TO SCAN TEXTS I

Re: Python Exercises for Newbee

2005-05-30 Thread Bruno Desthuilliers
Kanthi Kiran Narisetti a écrit : > Hi ALL, > > I am Windows Administrator, moving little ahead from batch files and > scripts I started learning Python. I found that Python is very easy and > is very well documented. Still I am looking more than examples. As a > beginner i want to do lot of excers

Re: finding indices in a sequence of parentheses

2005-05-30 Thread tiissa
Peter Otten wrote: > I think no amount of testing will give these strange people confidence. > "Proof" is the magic word here. Some would maybe be satisfied if your tests cover the whole set of input. When that's possible, that may be useless. But that's not a matter to bother them with. ;) (An

Re: finding indices in a sequence of parentheses

2005-05-30 Thread Peter Otten
tiissa wrote: > Not tested but confident is an oxymoron for mathemtaticians. I think no amount of testing will give these strange people confidence. "Proof" is the magic word here. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Exercises for Newbee

2005-05-30 Thread vincent wehren
"Kanthi Kiran Narisetti" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Hi ALL, Hi to you too! | | I am Windows Administrator, moving little ahead from batch files and | scripts I started learning Python. I found that Python is very easy and | is very well documented. Still

Re: avl tree

2005-05-30 Thread Berthold Höllmann
Zunbeltz Izaola <[EMAIL PROTECTED]> writes: > Hi, > > I'm trying to install avl module from > http://www.nightmare.com/squirl/python-ext/avl > > and i had the following instruction to install > > Building: > > Unix: > First, cd $(AVL_LIB), then 'make libavl.a' > > Then copy AVLmodule.c into your M

Re: Unicode Congruence

2005-05-30 Thread John Machin
phil wrote: > I can't find, Having looked where? > anyone know the unicode symbol > CONGRUENT. > either tilde over equal or triple > tidde would do. > Thanks. > Go to http://www.unicode.org click on: Where is my Character? follow your nose till you get to: http://www.unicode.org/c

Exiting SocketServer: socket.error: (98, 'Address already in use')

2005-05-30 Thread Magnus Lycka
I have a socket server like below which I want to exit when it's out of data. If I interrupt the client, I'll get a broken pipe on the server side, and after a Ctrl-C, I can restart the server again, but if I let it run out of data, and exit via handle_error as can be seen below, I will get a socke

Re: How to run functions in the background?

2005-05-30 Thread Terry Reedy
"Ognjen Bezanov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I need to find a way to 'fork' a function into the background yet still > be able to send commands to it. Others gave you the answer to this.. > I am writing a media player, and I have a function which plays the > me

Re: decimal numarray

2005-05-30 Thread Robert Kern
km wrote: > Hi all, > is there any support for decimal type in numarray module ? Not specifically, no. However, there is the concept of an "object array," which are arrays of arbitrary Python objects. See numarray.objects . -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the gr

Re: finding indices in a sequence of parentheses

2005-05-30 Thread tiissa
Peter Otten wrote: > tiissa wrote: >>Disclaimer: not tested further than example above (but confident). > > Not tested but confident should be an oxymoron for a programmer. Not tested but confident is an oxymoron for mathemtaticians. Programmers know better than that, they leave bugs in their cod

decimal numarray

2005-05-30 Thread km
Hi all, is there any support for decimal type in numarray module ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

How do you drive-by-wire a car using Python ?

2005-05-30 Thread [EMAIL PROTECTED]
Hello everybody, Our entry in the DARPA Grand Challenge race uses Python as a programming language. For those of you who are interested, we are beginning to put some of our code on our blog. Before being autonomous, our vehicle (a four wheel drive Jeep) has to first be driven by wire, i.e. use co

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Terry Reedy
"D H" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Elliot Temple wrote: >> Hi I have two questions. Could someone explain to me why Python is >> case sensitive? I find that annoying. > > I do too. I don't. > As you've found, the only reason is because it is, False. As someo

Unicode Congruence

2005-05-30 Thread phil
I can't find, anyone know the unicode symbol CONGRUENT. either tilde over equal or triple tidde would do. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

standard doc style for method signatures

2005-05-30 Thread David S.
Is there a generally accepted way to denote method signatures---that is, expected type or required interface for each argument. -- http://mail.python.org/mailman/listinfo/python-list

Re: write to the same file from multiple processes at the same time?

2005-05-30 Thread Mike Meyer
gabor <[EMAIL PROTECTED]> writes: > ok, i ended up with the following code: > > def syncLog(filename,text): > f = os.open(filename,os.O_WRONLY | os.O_APPEND) > fcntl.flock(f,fcntl.LOCK_EX) > os.write(f,text) > #FIXME: what about releasing the lock? > os.close(f) > > it see

Uk Shoppers - Discount Vouchers and Promotional Codes - NOREPLY

2005-05-30 Thread savemoney
Do you shop online? Do you want to save money? Discount vouchers and promotional codes exist for a wide range of on-line retailers. A comprehensive list of these retailers are to be found here: http://www.ukshops.h15.ru/vouchers.html The site includes codes and vouchers for top UK shops such as

Python Exercises for Newbee

2005-05-30 Thread Kanthi Kiran Narisetti
Hi ALL, I am Windows Administrator, moving little ahead from batch files and scripts I started learning Python. I found that Python is very easy and is very well documented. Still I am looking more than examples. As a beginner i want to do lot of excersice from simple addition to complex ...which

Re: How to run functions in the background?

2005-05-30 Thread Will McGugan
Ognjen Bezanov wrote: > Hello > > > I need to find a way to 'fork' a function into the background yet still > be able to send commands to it. > > I am writing a media player, and I have a function which plays the > media. I want to be able to run this function but to (at the same time) > be able

Re: how to convert string to list or tuple

2005-05-30 Thread Steven Bethard
Duncan Booth wrote: > Steven Bethard wrote: > >>But you can try it at home if you set __builtins__ to something other >>than the default: >> >>py> eval("""__import__("os").system('echo "hello"')""", >>dict(__builtins__=None)) >>Traceback (most recent call last): >> File "", line 1, in ? >> F

Re: How to run functions in the background?

2005-05-30 Thread Grant Edwards
On 2005-05-30, Ognjen Bezanov <[EMAIL PROTECTED]> wrote: > I need to find a way to 'fork' a function into the background > yet still be able to send commands to it. http://docs.python.org/lib/module-popen2.html -- Grant Edwards grante Yow! I'm a fuschia bowling

Re: __getattribute__ and __getattr__

2005-05-30 Thread Gigi
Terry Reedy wrote: > "Gigi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Hi, >>In the Python documentation regarding __getattribute__ (more attribute >>access for new style classes) it is mentioned that if __getattribute__ >>is defined __getattr__ will never be called (unless

How to run functions in the background?

2005-05-30 Thread Ognjen Bezanov
Hello I need to find a way to 'fork' a function into the background yet still be able to send commands to it. I am writing a media player, and I have a function which plays the media. I want to be able to run this function but to (at the same time) be able to send commands from it (e.g. pause, p

avl tree

2005-05-30 Thread Zunbeltz Izaola
Hi, I'm trying to install avl module from http://www.nightmare.com/squirl/python-ext/avl and i had the following instruction to install Building: Unix: First, cd $(AVL_LIB), then 'make libavl.a' Then copy AVLmodule.c into your Modules directory. add a few lines like this to your Python/Modules

Re: plotting with Python

2005-05-30 Thread Philippe C. Martin
Look at wxPython Regards, Philippe Rolf Wester wrote: > Hi, > > I have a Python console application that is intended to be used > interactively and I have to add plotting capabilities (multiple XY plots > and if possible 2D-surface plots). I'm loocking for a reasonably fast > plotting librar

Re: first release of PyPy

2005-05-30 Thread Rocco Moretti
Kay Schluehr wrote: > Anton Vredegoor wrote: > > >>I'm not involved in PyPy myself but this would seem a logical >>possibility. To go a step further, if the compiler somehow would know >>about the shortest machine code sequence which would produce the >>desired effect then there would be no reaso

Re: prime number

2005-05-30 Thread Rocco Moretti
lostinpython wrote: > But needless to say, I'm stumped on this > problem. I keep ending up in a never ending loop. I've been told that the trick with recursion/iteration is to always determine what your ending condition is first, and then construct the body of the recursion/loop to reach that e

Re: Software licenses and releasing Python programs for review

2005-05-30 Thread Rocco Moretti
poisondart wrote: > With the exception of the example with neighbour Bobby (which directly > utilizes my code for profit, in which case is a definite no), I don't > see why your other examples should make me reconsider releasing my > software for free. I don't think he's trying to make you recons

Re:

2005-05-30 Thread Paul English
Thanks for sending me email, but please click the following link or else my mail server will not deliver your message to me: http://blade.f7.net/cr.cgi/pme/[EMAIL PROTECTED] I use this system to prevent spam. Once you click the above link, you will be added to the whitelist and not be challenge

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread D H
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, D H <[EMAIL PROTECTED]> wrote: > > >>Elliot Temple wrote: >> >>>Hi I have two questions. Could someone explain to me why Python is >>>case sensitive? I find that annoying. >> >>I do too. As you've found, the only reason is because it is, and

Python crash

2005-05-30 Thread Stormbringer
I am using latest python 2.4 under Windows. I have a file where I have a bunch of functions, but none with a special name and nothing outside the functions, no import etc In the main module all works fine if I don't import that file. The moment I import it nothing happens but I get a crash later

Re: Is pyunit still usable?

2005-05-30 Thread John Roth
PyUnit came with a GUI, which is not part of the unittest version in the standard library. I don't know whether the GUI from PyUnit still works with the version of unittest in the standard library, but other than that, there is no reason to maintain the PyUnit branch. John Roth "could ildg" <[

Re: How to restrict lenght of entry widget to certain number of character

2005-05-30 Thread Michael Onfrek
I'm using tkinter -- http://mail.python.org/mailman/listinfo/python-list

Re: Is pyunit still usable?

2005-05-30 Thread Kent Johnson
could ildg wrote: > I want to know something about unittest these days, > and since I'm learning python, I want to touch it through > python. But when I found the newest pyunit is even so > old, I wonder if it is still usable for current python version > 2.4. Will you please tell me? Thank you. un

Re: Threading questions

2005-05-30 Thread Antal Rutz
Magnus Lycka wrote: > Antal Rutz wrote: > >>Hi, All! >> >>I'm new to threading. I have some design questions: >>Task: I collect data and store them in an RDBMS (mysql or pgsql) >> >>The question is how to do that with threading? >>The data-collecting piece of the code runs in a thread. >> >>1. Ope

Is pyunit still usable?

2005-05-30 Thread could ildg
I want to know something about unittest these days, and since I'm learning python, I want to touch it through python. But when I found the newest pyunit is even so old, I wonder if it is still usable for current python version 2.4. Will you please tell me? Thank you. What are the advantages and di

Re: Software licenses and releasing Python programs for review

2005-05-30 Thread John J. Lee
"poisondart" <[EMAIL PROTECTED]> writes: [...] > I plan to release my programs for academic and pedagogical purposes. > The knowledge contained in these programs is the same knowledge that > people use to speak a language--did you buy a copy of the English > language when you decided to learn it? >

Re: Newbie learning OOP 2nd ?

2005-05-30 Thread LenS
Thank you for your suggestion and especially your time. I will study your code:-) Len Sumnler -- http://mail.python.org/mailman/listinfo/python-list

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Leif K-Brooks
Roy Smith wrote: > Just wait until the day you're trying to figure out why some C++ function > is behaving the way it is and you don't notice that a 50-line stretch of > code is commented out with /* at the top and */ at the bottom. The same thing's happened to me in Python when I accidentally i

Re: Newbie learning OOP 2nd ?

2005-05-30 Thread [EMAIL PROTECTED]
I would split your code such that the Q&A is seperated from the calculations, and I would model the bill something like : class allbills(object): def __init__(self, bill, tip): self._bill = bill self._tip = tip def gettip(self): return self._tip / 100.0 tip = p

Re: Threading questions

2005-05-30 Thread Magnus Lycka
Antal Rutz wrote: > Hi, All! > > I'm new to threading. I have some design questions: > Task: I collect data and store them in an RDBMS (mysql or pgsql) > > The question is how to do that with threading? > The data-collecting piece of the code runs in a thread. > > 1. Open the db, and each thread

Re: Is there a better way of doing this?

2005-05-30 Thread Magnus Lycka
Steven D'Aprano wrote: > print is a statement, not a function. The brackets are syntactically > correct, but pointless. Remove them. ... > On Sat, 28 May 2005 13:24:19 +, Michael wrote: >> while( newNS ): > > Guido (our Benevolent Dictator For Life and creator of Python) hates > seeing white

Re: How to restrict lenght of entry widget to certain number of character

2005-05-30 Thread flupke
Michael Onfrek wrote: > Hi! > I'm playing with entry again and trying to restrict length of entry > widget to certain number of character, so users cannot enter more > character into it. Any ideas? > Reg. Michael Onfrek > What widget set are you talking about, wxPython pygtk, tkinter? In wxPytho

Re: Monitoring Outgoing Connections?

2005-05-30 Thread Peter Hansen
Joseph Chase wrote: > Is it possible to write a client within Python that would trigger some sort > of callback interface when the user is attempting to make an outgoing TCP/IP > connection? I'd like to accomplish this on a Windows XP box. > > Is this something that could be accomplished with t

Re: prime number

2005-05-30 Thread phil
> What civil engineers need with all this programming is beyond me. One of my best friends and expartner and top civil-structural engineers in the country (he built Dallas Reunion Arena and many other complex structures) was an ace programmer in many languages. He was not willing to just accep

Newbie learning OOP 2nd ?

2005-05-30 Thread LenS
I have coded this little program which is a small little tip calculator program. I am in the process of trying to convert this program to use OOP. Would appreciate others more experienced in OOP code in how they might do it. Would be happy to forward all profits from the sale of the program;-))

Re: write to the same file from multiple processes at the same time?

2005-05-30 Thread gabor
gabor wrote: > Jp Calderone wrote: > >> To briefly re-summarize, when you want to acquire a lock, attempt to >> create a directory with a well-known name. When you are done with it, >> delete the directory. This works across all platforms and filesystems >> likely to be encountered by a Pytho

Re: how to convert string to list or tuple

2005-05-30 Thread Duncan Booth
Steven Bethard wrote: >> Have you tried giving it the string '__import__("os").system("rm -rf >> *")'? [Don't try that at home children!] > > But you can try it at home if you set __builtins__ to something other > than the default: > > py> eval("""__import__("os").system('echo "hello"')""", >

Re: write html-headers (utf-8)

2005-05-30 Thread Kent Johnson
db wrote: > Hello all, > > I hope this is the correct newsgroup for this question. > > Does anybody know how I can write a html-header with python(cgi)? > The problem is, I have a few html templates in which I have a header e.g: > > "http://www.w3.org/TR/html4/strict.dtd";> > > > If you ar

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread Arthur
On Thu, 26 May 2005 16:24:39 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >"Elliot Temple" <[EMAIL PROTECTED]> writes: > >> Hi I have two questions. Could someone explain to me why Python is >> case sensitive? I find that annoying. > >Because it comes from a language background of case sensitive

Re: Newbie learning OOP

2005-05-30 Thread LenS
You are correct, the code so far is just a simple problem to learn OOP. Oh by the way I don't work for Dept. of Homeland Security just remember "drop those fingernail clipers and step away from those shoes:-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie learning OOP

2005-05-30 Thread LenS
Thanks for the reply. I will be looking over you code. I'm trying to learn OOP. It just hasn't sunk in yet;-\ -- http://mail.python.org/mailman/listinfo/python-list

Re: write html-headers (utf-8)

2005-05-30 Thread Benjamin Niemann
db wrote: > Hello all, > > I hope this is the correct newsgroup for this question. > > Does anybody know how I can write a html-header with python(cgi)? > The problem is, I have a few html templates in which I have a header e.g: > > "http://www.w3.org/TR/html4/strict.dtd";> > > > > In this

Re: Determine if windows drive letter is hard drive or optical from python?

2005-05-30 Thread Magnus Lycka
Wolfgang Strobl wrote: > ... for drive in string.letters[len(string.letters)/2:]: Or better... ..for drive in string.ascii_uppercase: string.letters differ with locale, but Windows drives are always only A-Z (right?) and just iterating over upper case (or lower) seems more clear than

Re: Get number of lines in file

2005-05-30 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Thanks! I was trying len(cpn_version) and that didn't work. What's your problem? You get a value that's one more than you expected? You should use splitlines() instead of split('\n'), or easier, use readlines() instead of read(). Of course, with a modern python you can

Re: 2D vector graphics Problem

2005-05-30 Thread Fredrik Lundh
Scott David Daniels wrote: > Your equation for y uses the new x, not the old x. Be more free with > names. Here's one way to write it: > > class ... > def rotate(self, angle): > '''Rotate point angle radians around relPoint''' > x, y = self.coords > xRel, yRel = self.

plotting with Python

2005-05-30 Thread Rolf Wester
Hi, I have a Python console application that is intended to be used interactively and I have to add plotting capabilities (multiple XY plots and if possible 2D-surface plots). I'm loocking for a reasonably fast plotting library (not GPL'ed, needs not be for free) that can be used under Windows

Re: where can i find pylibpcap module for win32?

2005-05-30 Thread ionel
i've compiled a pcapy http://lenoi.3x.ro/ works fine ( using it :) ) On 5/30/05, jerky <[EMAIL PROTECTED]> wrote: > thanks for your any imformation. > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- ionel. -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp for sequence of quoted strings

2005-05-30 Thread Magnus Lycka
gry@ll.mit.edu wrote: > I have a string like: > {'the','dog\'s','bite'} > or maybe: > {'the'} > or sometimes: > {} ... > I want to end up with a python array of strings like: > > ['the', "dog's", 'bite'] Assuming that you trust the input, you could always use eval, but since it seems fairly ea

Re: Tkinter slowes down

2005-05-30 Thread Fredrik Lundh
Eric Brunel wrote: >> In the meantime I found that widget.destroy() works well, too (before >> "repainting"). > > This was the only solution I found using "regular" Tkinter widgets when > there are bindings on canvas items. I tried to find another solution by > modifying Tkinter.py, but the proble

Re: Design problem, call function from HTML?

2005-05-30 Thread deelan
bart wrote: (...) > Is there any remote possibility u can pulloff the same in python? Now > i have to process my data to display page and do it again to generate > my image (execute same code twice). > > One solution would be to save the image to harddisk and then load it. > But rather keep it cle

  1   2   >