Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-01 Thread Dan Bishop
Dan Bishop wrote: Shane Hathaway wrote: pythonchallenge wrote: For the riddles' lovers among you, you are most invited to take part in the Python Challenge, the first python programming riddle on the net. You are invited to take part in it at: http://www.pythonchallenge.com

Re: compare two voices

2005-05-01 Thread Qiangning Hong
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. No, my goal is nothing relative to voice recognition. Sorry that I haven't described my question clearly. We are not

Re: ANN: pynetwork 2.25

2005-05-01 Thread [EMAIL PROTECTED]
I can't understand why name a graph library 'nework' :) -- http://mail.python.org/mailman/listinfo/python-list

Re: pstats: negative time values

2005-05-01 Thread Andrew Dalke
A few days ago Tom Mortimer wrote: A quick question - can anyone tell me how to interpret negative time values in pstats.Stats.print_stats() output? See http://docs.python.org/lib/profile-limits.html After the profiler is calibrated, it will be more accurate (in a least square sense), but

Re: Interrupting execution of PyRun_SimpleScript()

2005-05-01 Thread Andrew Dalke
A few days ago stephan wrote: Im am using PyRun_SimpleString() inside a BCB 5.0 GUI app on win32. Never used it so can only offer a suggestion. For this I have a button called stop, and when the user executes it, I generate an exeption by calling: PyRun_SimpleString(raise

Re: Tkinter weirdness item count

2005-05-01 Thread Peter Otten
phil wrote: def __del__(s): line.count = line.count - 1 ## delete the line object if the ## class instance is deleted s.glob.can.delete(s.obj) After the rotation I check line.count and it is 3 Did you know that exceptions are ignored in the __del__() method? One way to verify that

Running script in background.

2005-05-01 Thread Harlin Seritt
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 --

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,

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 thoughts

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])

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 question

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

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

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 requirements then

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

Re: ANN: pynetwork 2.25

2005-05-01 Thread bearophileHUGS
Kay SchluehrWhat 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

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

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

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 certain

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

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

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 and the most

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

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

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 good sounds

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, simply

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

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 Code completion and debugger

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

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 than

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

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

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

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

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. Any other

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 synchronized

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 Office VBA

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 the

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

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 (such as Java, Perl,

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

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

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 Idea what

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

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

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

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

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 to

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

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 probably the

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 be

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 harder either.

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: 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 likely not

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

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

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.Frame): NameError:

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

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 stdin, line 1, in ? TypeError: Error when calling the metaclass bases Cannot create a consistent method

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

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 --

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.stdout = def_stdout print

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 evaluates each

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

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 --

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_threads

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 listener

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

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:

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 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 out

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 string, line 1, in sendall socket.error: (10055, 'No buffer

Re: Debugging threaded Python code

2005-05-01 Thread Jp Calderone
On Mon, 02 May 2005 12:52:30 +1000, Derek Thomson [EMAIL PROTECTED] wrote: Hi, I frequently have to debug some fairly tricky Python multi-threaded code, and I need some help using the debugger to help me diagnose the problems when they occur. Yes, I know that the best option with threaded code

Need Help Creating File Structures

2005-05-01 Thread tim.tadh
Hi I am writing a program that allows a user to annotate text documents, and later html, html variants, and PDF files. My program is able to load multiple documents at once and creat linked anotations between these documents. Therefore i want to create a custom system to save the files. Ideally I

Re: MRO problems with diamond inheritance?

2005-05-01 Thread M.E.Farmer
I knew it was a feature but had only a few minutes to answer and was playing it safe ;) You would be surprised how many answers you can squeeze out of that one URL. That whole page is worth a month of study( for me anyway ). I am still trying to grasp the 'purpose' of classmethods. Michele

Re: Webbrowser On Windows

2005-05-01 Thread M.E.Farmer
Awesome! works perfectly on win2k - I.E 6 Python makes COM almost readable ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: socket error on windows, working fine on mac

2005-05-01 Thread Heiko Wundram
Am Montag, 2. Mai 2005 04:35 schrieb Thomas: I am getting socket error for large file transfer on windows (100MB+) Get an operating system... :-) No, seriously, I think that the problem might be that WinSock doesn't block the sending process while it can't send out the data. Thus: the internal

Re: Webbrowser On Windows

2005-05-01 Thread M.E.Farmer
I played around with it. import pythoncom from win32com.client import Dispatch def webbrowser(url=None): ie =

[ python-Feature Requests-1184678 ] replace function should accept lists.

2005-05-01 Thread SourceForge.net
Feature Requests item #1184678, was opened at 2005-04-17 19:05 Message generated for change (Comment added) made by poromenos You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=355470aid=1184678group_id=5470 Category: None Group: None Status: Open Resolution: Rejected