How to kill a SocketServer?

2005-05-01 Thread Paul Rubin
Let's say you have a SocketServer with the threading mix-in and you run serve_forever on it. How can you shut it down, or rather, how can it even shut itself down? Even if you use a handle_request loop instead of serve_forever, it still seems difficult: class myserver(ThreadingMixIn, TCPSer

Re: Doubt regarding python Compilation

2005-05-01 Thread Andrew Dalke
praba kar wrote: > I want to know whether Python is compiler language > or interpreted language. If Python is interpreter > language why compilation is there. That distinction is implementation dependent and not an aspect of the language. How would that knowledge affect your decisions or thought

Re: Numeric/Numarray equivalent to zip ?

2005-05-01 Thread Peter Otten
George Sakkis wrote: > What's the fastest and most elegant equivalent of zip() in > Numeric/Numarray between two equally sized 1D arrays ? That is, how to > combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I > expect the fastest and the most elegant idiom to be identical, as it is >

Re: Trying to write CGI script with python...

2005-05-01 Thread Peter Otten
M.E.Farmer wrote: > I found an excellent example that was posted by the F-bot. > Fredrik LundhMay 26 2000 Python has since grown the cgitb module. Putting import cgitb; cgitb.enable() at the top of your cgi script may be even more convenient than using the Lundhian wrapper. Peter -

Re: How do I parse this ? regexp ?

2005-05-01 Thread Andrew Dalke
[EMAIL PROTECTED] wrote: > Thank you, it works, but I guess not all the way: > but I need to remove the first - between 18:20:42 and 0.024329 but not > the others. Read the documentation for the string methods. http://docs.python.org/lib/string-methods.html replace(old, new[, count]) Ret

Re: compare two voices

2005-05-01 Thread Andrew Dalke
> Jeremy Bowers wrote: >> No matter how you slice it, this is not a Python problem, this is an >> intense voice recognition algorithm problem that would make a good >> PhD thesis. Qiangning Hong wrote: > No, my goal is nothing relative to voice recognition. Sorry that I > haven't described my que

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-01 Thread Roel Schroeven
Dan Bishop wrote: Dan Bishop wrote: Correction: Now I'm stuck on Level 11. I think I'm supposed to do something with the pixels in the image, but what? Me too. I've tried making different images out of the even and the odd pixels, but nothing interesting happened. I tried to combine both images

Re: How to kill a SocketServer?

2005-05-01 Thread Andrew Dalke
Paul Rubin wrote: > Let's say you have a SocketServer with the threading mix-in and you > run serve_forever on it. How can you shut it down, or rather, how can > it even shut itself down? I looked at CherryPy's server because I know it uses Python's BaseHTTPServer which is derived from SocketSer

Re: Best way to create temporary file?

2005-05-01 Thread Frank Millman
Frank Millman wrote: > > Hi all > > > > I need to generate potentially large reports from a database, and I > > want to offer the option of print preview before actually printing > > (using wxPython). I figure that the best way to achieve this is to > > write the report to a temporary file, or more

Re: Best way to parse file into db-type layout?

2005-05-01 Thread Michael Hoffman
John Machin wrote: >[Michael Hoffman]: What if the input is UTF-16? Your solution won't work for that. And there are certainly UTF-16 CSV files out in the wild. The csv module docs do say that Unicode is not supported. This does appear to work, however, at least for data that could in fact be encod

wxPython: ansi or unicode?

2005-05-01 Thread monkey
Hi all, which should be install? Really confused @@... Is that mean unicode version used for programming in language other than English? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to parse file into db-type layout?

2005-05-01 Thread John Machin
On Sat, 30 Apr 2005 23:11:48 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: >John Machin wrote: >> If the job at hand is simulating awk's file reading habits, yes then >> fileinput is convenient. However if the job at hand involves anything >> like real-world commercial data processing requiremen

Re: wxPython: ansi or unicode?

2005-05-01 Thread Robert Kern
monkey wrote: Hi all, which should be install? Really confused @@... Unicode. Is that mean unicode version used for programming in language other than English? No. The Unicode version allows the underlying wxWidgets GUI toolkit to use Unicode text. You want this. On certain platforms, older versi

Re: ANN: pynetwork 2.25

2005-05-01 Thread bearophileHUGS
Kay Schluehr>What is wrong with the other librarys that they can't be approved?< I presume there are so many kinds of graphs, that one data structure doesn't fit all... On the other hand, I think that trying to design a too much general data structure can have some drawbacks. I've tried a compromi

ERP & CRM in Python

2005-05-01 Thread pinky
Hello, We released an open source complete ERP & CRM in Python; http://tinyerp.org The main features are; . customers/suppliers relationship managment, . accounting (analytic & financial), . stock management, . sales & purchases managment, . tasks automation, . marketing campaign

editor for shelve files

2005-05-01 Thread Amir Michail
Hi, Is there a program for editing shelve databases? Amir -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-01 Thread Roel Schroeven
Roel Schroeven wrote: Dan Bishop wrote: Dan Bishop wrote: Correction: Now I'm stuck on Level 11. I think I'm supposed to do something with the pixels in the image, but what? Me too. There's a new image on the website now (still the same name though); I solved the riddle now :-) There's no leve

Re: compare two voices

2005-05-01 Thread Kent Johnson
Qiangning Hong wrote: I want to make an app to help students study foreign language. I want the following function in it: The student reads a piece of text to the microphone. The software records it and compares it to the wave-file pre-recorded by the teacher, and gives out a score to indicate the

Re: wxPython: ansi or unicode?

2005-05-01 Thread monkey
Many Thanks ( : > > Hi all, which should be install? Really confused @@... > > Unicode. > > > Is that mean unicode version used for programming in language other than > > English? > > No. The Unicode version allows the underlying wxWidgets GUI toolkit to > use Unicode text. You want this. > > On c

Setting the corner color in rotated PIL images

2005-05-01 Thread rzed
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black (which is not, in this case). I can't find any documented way to change the default fill color (if th

tkMessageBox dialog help

2005-05-01 Thread Nathan
Hi, I've been testing the standard dialog boxes in tkMessageBox under IDLE. If I type for example, tkMessageBox.askyesno('test', 'test'), the dialog box comes up fine but another window also appears. I'm guessing this is the parent window of the message box. If I click on either of the yes/no b

Re: Numeric/Numarray equivalent to zip ?

2005-05-01 Thread George Sakkis
"Peter Otten" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > > What's the fastest and most elegant equivalent of zip() in > > Numeric/Numarray between two equally sized 1D arrays ? That is, how to > > combine two (N,)-shaped arrays to one (N,2) (or (2,N)) shaped ? I > > expect the fastest a

Re: Killing process

2005-05-01 Thread Harlin Seritt
I actually tried mapping the PID to an integer value and it still didn't work. At any rate, I found another way to do it. Thanks anyways. -- http://mail.python.org/mailman/listinfo/python-list

Re: tkMessageBox dialog help

2005-05-01 Thread Harlin Seritt
Nathan, >From what I've seen I'm afraid this is the way it is. If you call an instance of tkMessageBox and you don't have a 'master' Tk instance running, it will create its own. Still, I'm sure with a bit of voodoo you can hide the self created tk window while showing the message box. If you find

Re: Numeric/Numarray equivalent to zip ?

2005-05-01 Thread Peter Otten
George Sakkis wrote: > Though not the fastest to execute; using concatenate instead of > initializing an array from a list [a,a] is more than 2,5 time faster in > my system (~4.6 vs 11.8 usec per loop according to timeit.py), and it's > not harder either. That surprises me. I would expect essent

gtk/qt scintilla help !

2005-05-01 Thread fabien
Hi, I am writing a POV-RAY editor with Python using either QT or GTK as GUI 'wrapper'. ( I am still trying both ) * * * * PYGTK * * * * I have downloaded PygtkScintilla-1.99.5. There is a lexPOV.cxx file in the package, but I can not find any POV keywords in any file ( there are about 150 POV ke

Re: compare two voices

2005-05-01 Thread François Pinard
[Qiangning Hong] > I just want to compare two sound WAVE file, not what the students or > the teacher really saying. For example, if the teacher recorded his > "standard" pronouncation of "god", then the student saying "good" will > get a higher score than the student saying "evil" because "

Re: Can .py be complied?

2005-05-01 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: > John J. Lee wrote: [...] > > I'm hesitant to label everybody who disagrees with you (and me) on > > that a zealot. Though I tend to take the same side you do, I'm not [...] > Well, we appear to agree. Please note I wasn't labelling anyone a > zealot, sim

Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Engineer
I'm looking for a Python interpreter written in BASIC, preferably Visual Basic, and one written in VBA would be best of all. An alternative would be a Python-2-Basic compiler. Unfortunately I have to develop some special purpose code in an organization where my only development environment is Mic

Re: Which IDE is recommended?

2005-05-01 Thread John J. Lee
Ville Vainio <[EMAIL PROTECTED]> writes: > > "John" == John J Lee <[EMAIL PROTECTED]> writes: > > John> Dave Cook <[EMAIL PROTECTED]> writes: > > John> What are those compelling features of Pydev, for an emacs > John> user? > > http://pydev.sourceforge.net/features.html > > Cod

Re: Running script in background.

2005-05-01 Thread Larry Bates
You have two choices: 1) You can use Windows Scheduler to run the script in the background. I have lots of scripts that I do this with. 2) You can convert the script into a Windows Service, which will run in the background continuously. I know of no way to manually start something in the foregr

Re: How to track down all required shared libraries?

2005-05-01 Thread Miki Tebeka
Hello sdhyok, > Now, I am in the situation to run the same program but on several > different machines with the same Linux OS. To avoid the reinstallation, > I like to pack up all shared libraries into a directory. Is there a > good way to track down all shared libraries required to run a Python >

Re: Writing to log file when script is killed

2005-05-01 Thread Miki Tebeka
Hello Heiko, > Am Samstag, 30. April 2005 14:26 schrieb [EMAIL PROTECTED]: > > If you run on unix you can use the signal module to intercept a kill - > > see http://docs.python.org/lib/node368.html for a quick example > > You cannot intercept a kill (that's the whole meaning of SIGKILL, rather th

Re: tkMessageBox dialog help

2005-05-01 Thread garyr
Nathan wrote: > Hi, > > I've been testing the standard dialog boxes in tkMessageBox under IDLE. > If I type for example, tkMessageBox.askyesno('test', 'test'), the dialog box > comes up fine but another window also appears. I'm guessing this is the > parent window of the message box. If I click on

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Larry Bates
I don't think this is going to happen. Applications that drive MS Office applications merely call COM objects that perform the actual operations. It doesn't really matter what language calls the COM objects, they are the same objects all the time. If they don't like the "installation" of the Pyt

Re: Reusing object methods?

2005-05-01 Thread Joal Heagney
Axel Straschil wrote: Hello! Why not: class A: def a_lengthy_method(self, params): # do some work depending only on data in self and params class B(A): pass ? Lg, AXEL. As a rough guess, I think the original poster was wondering how to include *one* specific method from class A into

Re: Reusing object methods?

2005-05-01 Thread Michele Simionato
If you need just a single method once, don't use a mixin; just do B.meth = A.meth.im_func. Do not underestimate the burden of mixins on people reading your code (at least, for me it is burden, since I have to draw the inheritance tree in my mind, look at which methods are involved, wonder about the

Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread fooooo
This is a network app, written in wxPython and the socket module. This is what I want to happen: GUI app starts. User clicks a button to 'start' the work of the app. When start is pressed, a new thread is spawned (threading module) and this thread starts listening for data on a socket. When someon

My personal candidate for QOTW (was: Python interpreter in Basic or a Python-2-Basic translator.)

2005-05-01 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Engineer <[EMAIL PROTECTED]> wrote: . . . >The security 'droids have decided that since the MS Office Suite is a >"standard" application then software written in MS Office VBA must be >"safe." A

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread Paul Rubin
"fo" <[EMAIL PROTECTED]> writes: > How would I get the worker thread to open a GUI window in the main GUI > thread? After that GUI window is open, how can I send and recv messages > from/to the GUI window? First of all the favorite Pythonic way to communicate between threads is with synchroniz

Re: My personal candidate for QOTW (was: Python interpreter in Basic or a Python-2-Basic translator.)

2005-05-01 Thread [EMAIL PROTECTED]
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Engineer <[EMAIL PROTECTED]> wrote: > . > . > . > >The security 'droids have decided that since the MS Office Suite is a > >"standard" application then software written in MS

Re: compare two voices

2005-05-01 Thread Robert Oschler
"Qiangning Hong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I want to make an app to help students study foreign language. I want > the following function in it: > > The student reads a piece of text to the microphone. The software > records it and compares it to the wave-file

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread Jp Calderone
On 01 May 2005 10:09:56 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: "fo" <[EMAIL PROTECTED]> writes: How would I get the worker thread to open a GUI window in the main GUI thread? After that GUI window is open, how can I send and recv messages from/to the GUI window? First of all

autoconf wizard wanted

2005-05-01 Thread Heiko Wundram
Hi all! Although it's slightly OT: I've written PAM, NSS and PPPd plugins which do authentication (and other things) against a running Python daemon, communicating via a Unix domain socket. For the C part of the whole adventure (the modules for PAM, NSS and PPPd), I'd love to have some form of

Re: My personal candidate for QOTW (was: Python interpreter in Basic or a Python-2-Basic translator.)

2005-05-01 Thread Leif Biberg Kristensen
Cameron Laird skrev: > In article <[EMAIL PROTECTED]>, > Engineer <[EMAIL PROTECTED]> wrote: > . > . > . >>The security 'droids have decided that since the MS Office Suite is a >>"standard" application then software written in MS Office VBA must be >>"safe." Any other development environments (su

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Do Re Mi chel La Si Do
Hi ! VBA is at the end of his lifetime. The next MS-Office will not have VBA (because dotNet). You should really adopt Python. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill a SocketServer?

2005-05-01 Thread Skip Montanaro
Paul> Let's say you have a SocketServer with the threading mix-in and Paul> you run serve_forever on it. How can you shut it down, or rather, Paul> how can it even shut itself down? Even if you use a Paul> handle_request loop instead of serve_forever, it still seems Paul> dif

Re: How to kill a SocketServer?

2005-05-01 Thread Paul Rubin
Skip Montanaro <[EMAIL PROTECTED]> writes: > I use precisely that scheme with (I think *) no problem. The only maybe > significant difference I see is that I subclass ThreadingMixin so that it > creates daemon threads: ... According to the docs, you don't need the subclass, you can just set the "

Wrapping c functions

2005-05-01 Thread Glenn Pierce
Hi I have been trying to wrap a c library called FreeImage for python and am having trouble with a couple of functions. One function is FreeImage_Load which takes parameters (enum, const char*, int) I have wrapped the function with the following code static PyObject * freeimage_load(PyObject *sel

Re: Wrapping c functions

2005-05-01 Thread Andrew Dalke
Glenn Pierce wrote: > if (!PyArg_ParseTuple(args, "isi", &format, filename, &flags)) > return NULL; Shouldn't that be &filename ? See http://docs.python.org/ext/parseTuple.html for examples. > dib = FreeImage_Load(format, filename, flags); > Also I have little Ide

Re: Webbrowser On Windows

2005-05-01 Thread andrea_gavana
>It seems to me that there is no way to create a new instance of Internet >Explorer (if there are already some IE windows opened). >Does anyone know a possible solution? Or a workaround (without using >startfile, maybe?) that will force IE to create a new instance? Should I suppose no solution exi

BitKeeper for Python?

2005-05-01 Thread John Smith
I am going to be working with some people on a project that is going to be done over the internet. I am looking for a good method of keeping everyone's code up to date and have everyone be able to access all the code including all the changes and be able to determine what parts of the code were cha

Whats the best Python Book for me

2005-05-01 Thread John Smith
I already know C/C++ programming and now wish to learn Python to do scripting for some games that are coming out. What book would you recommend. I am thinking Teach Your Self Python in 24 Hours is probably the best place to start... -- http://mail.python.org/mailman/listinfo/python-list

Re: BitKeeper for Python?

2005-05-01 Thread Jp Calderone
On Sun, 01 May 2005 20:16:40 GMT, John Smith <[EMAIL PROTECTED]> wrote: I am going to be working with some people on a project that is going to be done over the internet. I am looking for a good method of keeping everyone's code up to date and have everyone be able to access all the code including

Re: Whats the best Python Book for me

2005-05-01 Thread Jp Calderone
On Sun, 01 May 2005 20:18:39 GMT, John Smith <[EMAIL PROTECTED]> wrote: I already know C/C++ programming and now wish to learn Python to do scripting for some games that are coming out. What book would you recommend. I am thinking Teach Your Self Python in 24 Hours is probably the best place to sta

RE: BitKeeper for Python?

2005-05-01 Thread bruce
john you might check out trac and subversion/svn... CVS is often used as well... keep in mind that any app equires that you be willing to out in a certain amount of time for the admin of the project tool. if what you're creating is open source, you might as well go ahead and use the sourcefor

Re: Whats the best Python Book for me

2005-05-01 Thread Aahz
In article <[EMAIL PROTECTED]>, John Smith <[EMAIL PROTECTED]> wrote: > >I already know C/C++ programming and now wish to learn Python to do >scripting for some games that are coming out. What book would you >recommend. > >I am thinking Teach Your Self Python in 24 Hours is probably the best >place

msvccompiler issues

2005-05-01 Thread Lucas Raab
I'm trying to compile a package from source and whenever I tried to compile, distutils gave me error about not have VC7. However, I've got VB7 and so I've also got the VC7 compiler that came in the installation. BTW, I've got Visual Studio .NET 2003 and Python 2.4.1. I tried looking the distuti

Re: Whats the best Python Book for me

2005-05-01 Thread Ivan Van Laningham
Hi All-- > On Sun, 01 May 2005 20:18:39 GMT, John Smith <[EMAIL PROTECTED]> wrote: > >I already know C/C++ programming and now wish to learn Python to do > >scripting for some games that are coming out. What book would you recommend. > > > >I am thinking Teach Your Self Python in 24 Hours is proba

scope acting weird

2005-05-01 Thread Gabriel B.
i have the following code: Ui.py: import Tkinter as Tk import UiMainScreen UiMainScreen.py: class UiMainScreen( Tk.Frame ): and i get the following error: File "UiMainScreen.py", line 1, in ? class UiMainScreen(Tk.Frame): NameError: name 'Tk' is not defined isn't Tk supposed to b

Re: compare two voices

2005-05-01 Thread M.E.Farmer
Qiangning Hong wrote: > I want to make an app to help students study foreign language. I want > the following function in it: > > The student reads a piece of text to the microphone. The software > records it and compares it to the wave-file pre-recorded by the > teacher, and gives out a score to

Re: Numeric/Numarray equivalent to zip ?

2005-05-01 Thread George Sakkis
"Peter Otten" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > > Though not the fastest to execute; using concatenate instead of > > initializing an array from a list [a,a] is more than 2,5 time faster in > > my system (~4.6 vs 11.8 usec per loop according to timeit.py), and it's > > not harde

Re: Running script in background.

2005-05-01 Thread Nick Addison
Harlin Seritt wrote: Hi, I have a script.py that is converted to .exe using py2exe. From another script I call script.exe and would like to be able to run this script.exe in the background (as well as in console -- giving the user some simple options). How can I make this happen? thanks, Harlin Hav

Re: Writing to log file when script is killed

2005-05-01 Thread [EMAIL PROTECTED]
Ok, I was sloppy - I meant the regular kill, not the -9 version... -- http://mail.python.org/mailman/listinfo/python-list

Re: Whats the best Python Book for me

2005-05-01 Thread Michael Hartl
I'd like to second the recommendation for the Python Cookbook. As an experienced programmer, you'll learn a lot by osmosis. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping c functions

2005-05-01 Thread David M. Cooke
Andrew Dalke <[EMAIL PROTECTED]> writes: > Glenn Pierce wrote: >> if (!PyArg_ParseTuple(args, "isi", &format, filename, &flags)) >> return NULL; > > Shouldn't that be &filename ? See > http://docs.python.org/ext/parseTuple.html > for examples. > > >> dib = FreeImage_

Re: editor for shelve files

2005-05-01 Thread David M. Cooke
"Amir Michail" <[EMAIL PROTECTED]> writes: > Hi, > > Is there a program for editing shelve databases? > > Amir I doubt it. A shelf is basically just a file-based dictionary, where the keys must be strings, while the values can be arbitrary objects. An editor could handle the keys, but most likel

Re: Whats the best Python Book for me

2005-05-01 Thread Baishampayan
Hi, In my opinion, Mark Pilgrim's great book Dive Into Python is the best suited for somebody who already knows some programming. The book is a truly free book and is available in a wide range of formats. You can get it here http://diveintopython.org/ Enjoy! -bg- -- http://mail.python.org/mailman

Re: BitKeeper for Python?

2005-05-01 Thread Baishampayan
Hello John, If you just want a repository for one project and you don't want to admin the whole server [which is a job in itself], you can use Sourceforge's CVS server. They'll also let you host the project on their servers. If you want to setup your own SCM, you can try Subversion, GNU Arch, or if

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread John Perks and Sarah Mount
"fo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is a network app, written in wxPython and the socket module. This > is what I want to happen: I'm not sure if this will help you, but it solved what was, for me, a more general problem: not (normally) being able to issue w

Re: scope acting weird

2005-05-01 Thread Mike Meyer
"Gabriel B." <[EMAIL PROTECTED]> writes: > i have the following code: > > Ui.py: > import Tkinter as Tk > import UiMainScreen > > UiMainScreen.py: > class UiMainScreen( Tk.Frame ): > > > and i get the following error: > File "UiMainScreen.py", line 1, in ? > class UiMainScreen(Tk.Fr

Re: Webbrowser On Windows

2005-05-01 Thread M.E.Farmer
Hello Andrea, I have played around for a few seconds and have a few suggestions. The code is a little baffling it appears that there is no way to do that on windows. I have looked into Internet Explorer and have found that there is an option in Internet Explorer that controls this. In Internet Exp

MRO problems with diamond inheritance?

2005-05-01 Thread John Perks and Sarah Mount
Trying to create the "lopsided diamond" inheritance below: >>> class B(object):pass >>> class D1(B):pass >>> class D2(D1):pass >>> class D(D1, D2):pass Traceback (most recent call last): File "", line 1, in ? TypeError: Error when calling the metaclass bases Cannot create a consistent method

Re: Python interpreter in Basic or a Python-2-Basic translator.

2005-05-01 Thread Jeremy Bowers
On Sun, 01 May 2005 06:18:27 -0700, Engineer wrote: > The security 'droids have decided that since the MS Office Suite is a > "standard" application then software written in MS Office VBA must be > "safe." "Melissa". (Google hint: "Virus".) Given the brazen stupidity demonstrated by these decisio

sys.stdout question

2005-05-01 Thread chris patton
>>> import sys >>> class stuff: ... things = [] ... def write(self, string): ... self.things.append(string) ... >>> def_stdout = sys.stdout >>> sys.stdout = stuff() >>> print 'this is a string.' >>> print 'This is another string.' >>> sys.stdout = def_stdout >>> print stuf

Re: My personal candidate for QOTW (was: Python interpreter in Basic or a Python-2-Basic translator.)

2005-05-01 Thread Lee Cullens
From: Leif Biberg Kristensen <[EMAIL PROTECTED]> Date: May 1, 2005 2:13:43 PM EDT To: python-list@python.org Subject: Re: My personal candidate for QOTW (was: Python interpreter in Basic or a Python-2-Basic translator.) Cameron Laird skrev: In article <[EMAIL PROTECTED]>, Engineer <[EMAIL PROTE

Re: editor for shelve files

2005-05-01 Thread Amir Michail
David M. Cooke wrote: > "Amir Michail" <[EMAIL PROTECTED]> writes: > > > Hi, > > > > Is there a program for editing shelve databases? > > > > Amir > > I doubt it. A shelf is basically just a file-based dictionary, where > the keys must be strings, while the values can be arbitrary objects. > An ed

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread M.E.Farmer
Look inthe demo that comes with wxPython it is in tree process and events -> threads . There is a nice demo of PostEvent(). Another way would be to use Queues as others have mention . You can create a new frame and have it call the queue for data. M.E.Farmer -- http://mail.python.org/mailman/li

Re: sys.stdout question

2005-05-01 Thread Steve Holden
chris patton wrote: import sys class stuff: > > ... things = [] > ... def write(self, string): > ... self.things.append(string) > ... > def_stdout = sys.stdout sys.stdout = stuff() print 'this is a string.' print 'This is another string.' sys.

Re: sys.stdout question

2005-05-01 Thread M.E.Farmer
Print is the culprit here. Note item 2. >>> help('print') 6.6 The print statement print_stmt::="print" ( [expression[1] ("," expression[2])* [","]] | ">>" expression[3] [("," expression[4])+ [","]] ) Download entire grammar as text.[5] print e

Re: MRO problems with diamond inheritance?

2005-05-01 Thread M.E.Farmer
Your answer lies somewhere in this page ;) http://www.python.org/2.2.2/descrintro.html M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: MRO problems with diamond inheritance?

2005-05-01 Thread Robert Dick
M.E.Farmer: > Your answer lies somewhere in this page ;) > http://www.python.org/2.2.2/descrintro.html > M.E.Farmer delegate.py (use PyPI) may also be useful. -Robert Dick- -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to log file when script is killed

2005-05-01 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Ok, I was sloppy - I meant the regular kill, not the -9 version... You're still being sloppy. ;) The "-9 version" is called SIGKILL, hence the confusion (actually I doubt anyone is confused). What you mean is SIGTERM. Call it that and you will be safe even from the mo

are properties thread safe in this context?

2005-05-01 Thread vegetax
Class Req: def __init__(s,headers): s.headers = headers referer =\ property(lambda s:s.headers['Connection'], lambda s,v:s.headers.__setitem__('referer',v)) each thread has its own instance of class Req, Req instances are not shared between threads -- http://

Re: How to kill a SocketServer?

2005-05-01 Thread Skip Montanaro
>> I use precisely that scheme with (I think *) no problem. The only >> maybe significant difference I see is that I subclass ThreadingMixin >> so that it creates daemon threads: ... Paul> According to the docs, you don't need the subclass, you can just Paul> set the "daemon_

Re: Best way to create temporary file?

2005-05-01 Thread Michael Hoffman
Frank Millman wrote: > It is certainly possible to store the entire report in memory, using a > two-dimensional list (page/line), but if a report runs into hundreds of > pages, I am concerned at the amount of memory this would require. > Perhaps I am being old-fashioned - with todays memory of at

Re: How to kill a SocketServer?

2005-05-01 Thread Paul Rubin
Andrew Dalke <[EMAIL PROTECTED]> writes: > which means it went a different route. Looks like a > request comes in and is put to a work queue. Clients get > from it. There's a special work queue item to tell > the threads to stop. Well, ok, so the worker threads stop. How do you get the listene

Re: Whats the best Python Book for me

2005-05-01 Thread Luis M. Gonzalez
For someone expereinced like you, I recommend "Dive into Python". It is available online. There's also a very good tutorial which is aimed to both, beginners and experienced programmers, that can give you a very complete and high level overview of the python language: "A byte of Python". Also avail

Re: python and os.system() failure

2005-05-01 Thread Michael Hoffman
kennywiggin wrote: > .flac: ERROR while decoding data > state = FLAC__STREAM_DECODER_READ_FRAME > > The script fails to decode any more flac files until the vm > crashes from having too many open files. Whoa! Time to start using file.close() after you're done with each file. If that doesn't fix

Re: gtk/qt scintilla help !

2005-05-01 Thread Neil Hodgson
Fabien: > There is a lexPOV.cxx file in the package, but I can not find any POV > keywords in any file ( there are about 150 POV keywords). Did i miss it, > and if not, how do I create one and include it for the library building ? The Scintilla web site, documentation and mailing list are: h

Re: How to kill a SocketServer?

2005-05-01 Thread Skip Montanaro
Paul> Yes, this is precisely what I'm asking. How do you get the server Paul> to go away without going out of your way to connect to it again? Paul> Don't you notice if it stays around? Skip> It fields lots of requests, so it's possible that another request Skip> arrives afte

Re: Tripoli: a Python-based triplespace implementation

2005-05-01 Thread malkarouri
Dominic Fox wrote: > I have been working on a Python implementation of a modified Tuple > Space (cf Linda, JavaSpaces) that contains only 3-tuples (triples), > and that has operators for copying and moving graphs of triples as > well as sets matching a given pattern. It's called Tripoli, ... Inter

Re: How to kill a SocketServer?

2005-05-01 Thread Andrew Dalke
After I gave a reference to CherryPy's threaded SocketServer-based http server code Paul Rubin followed up: > Well, ok, so the worker threads stop. How do you get the listener > thread to stop, since it's blocked waiting for a new connection to arrive? I don't know the code well enough. You migh

Re: How to kill a SocketServer?

2005-05-01 Thread Paul Rubin
Skip Montanaro <[EMAIL PROTECTED]> writes: > def serve_forever(self): > while self.serving: > r,w,e = select.select([self.socket], [], [], self.pause) > if r: > self.handle_request() > > and set self.pause to something short-ish. The select call

Static Methods in Python

2005-05-01 Thread Kris
Hi, I am a newbie to Python. With a background in Java, I was attempting to write static methods in the class without the self as the first parameter, when I got an error. I did a search for the same on Google and found out that there was no consistent approach to this. I would like to know what

Displaying formatted - data with TKinter

2005-05-01 Thread custard_pie
Hi,..I found it difficult to display data from a dictionary using GUI. What widget should I use? I tried using text widget, but I couldn't get the display I want. I need the display to look like this file name size agelocation ===

Re: Static Methods in Python

2005-05-01 Thread Erik Max Francis
Kris wrote: > I am a newbie to Python. With a background in Java, I was attempting > to write static methods in the class without the self as the first > parameter, when I got an error. I did a search for the same on Google > and found out that there was no consistent approach to this. I would >

Re: Static Methods in Python

2005-05-01 Thread John Roth
"Kris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I am a newbie to Python. With a background in Java, I was attempting > to write static methods in the class without the self as the first > parameter, when I got an error. I did a search for the same on Google > and found

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-01 Thread Dan Christensen
Roel Schroeven <[EMAIL PROTECTED]> writes: > There's no level 12 yet though. Now there's a 12 and a 13 (at least!). Dan -- http://mail.python.org/mailman/listinfo/python-list

socket error on windows, working fine on mac

2005-05-01 Thread Thomas
I am getting socket error for large file transfer on windows (100MB+) Working fine for files <50MB.   Everything is working fine on mac..   File "C:\Python23\lib\httplib.py", line 576, in send     self.sock.sendall(str)   File "", line 1, in sendall socket.error: (10055, 'No buffer

  1   2   >