Re: Derived class and deepcopy

2005-02-17 Thread Fredrik Lundh
Philip Smith wrote: In the given example I want to apply deepcopy() to the Matrix instance (on initialisation) to ensure that the list part is not affected by subsequent changes to the initialising list or Matrix but this gives me a string of errors (some of which imply I'm trying to

Re: Problem using/installing numarray

2005-02-17 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: ImportError: No module named _conv The file _conf.pyd exists, but my guess is that the .pyd suffix is not recognized under the CygWin version of Python. (But that doesn't make sense...) you can use imp.get_suffixes() to get a list of supported extensions. here's

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread news.sydney.pipenetworks.com
Nick Vargish wrote: Leo Breebaart [EMAIL PROTECTED] writes: That suggests to me an obvious default of the kind that exists elsewhere in Python as well. I feel pretty much the opposite... If a non-string-type has managed to get into my list-of-strings, then something has gone wrong and I would

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Fredrik Lundh
news.sydney.pipenetworks.com wrote: Nick Explicit is better than Implicit Really ? Then why are you using python. Python or most dynamic languages are are so great because of their common sense towards the implicit. You must have heard of never say never but never say always (as in

RE: huge help for interactive python

2005-02-17 Thread Tim Golden
[David S.] [... snip recommendation of Gary Bishop's readline ...] | | I could not find a list of the keyboard commands | that readline supports, so I generated: | | http://fsinnovations.net/share/keymap.pdf Brilliant! Thanks very much. I've half-used ipython for several months, but I'm so

Re: low-end persistence strategies?

2005-02-17 Thread John Lenton
On Wed, Feb 16, 2005 at 10:43:42PM -0800, Michele Simionato wrote: snip simple example with flock What happens if for any reason the application crashes? Locked files will stay locked or not? And if yes, how do I unlock them? the operating system cleans up the lock. -- John Lenton ([EMAIL

:-)

2005-02-17 Thread Bart van Deenen
Jack Diederich [EMAIL PROTECTED] wrote: /tmp/ python Python 2.3.4 (#2, Jan 5 2005, 08:24:51) Type help, copyright, credits or license for more information. ^D :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) Bart -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with C extensions under VC6 / WinXP and Python 2.4

2005-02-17 Thread Fredrik Lundh
Simon John wrote: What's the difference between ctypes, SWIG and SIP? I've used SWIG to convert C source to Python (as I believe SIP does?), so does ctypes wrap functions from binaries (e.g. DLL's)? ctypes is a runtime linker. it generates bindings on the fly, at runtime, and doesn't

Re: low-end persistence strategies?

2005-02-17 Thread Michele Simionato
John Lenton: the operating system cleans up the lock. So, are you effectively saying than a custom made solution based on flock can be quite reliable and it could be a reasonable choice to use shelve+flock for small/hobbysts sites? I always thought locking was a bad beast and feared to implement

Re: Help with C extensions under VC6 / WinXP and Python 2.4

2005-02-17 Thread Miki Tebeka
Hello Simon, What's the difference between ctypes, SWIG and SIP? SIG and SIP take C/C++ *sources* and create Python modules. ctypes works directly with the binary dll. Bye. -- Miki Tebeka [EMAIL PROTECTED]

Best way to SIGHUP spamd from web page?

2005-02-17 Thread Robert Brewer
I'd like to be able to restart spamd (the SpamAssassin daemon) from a web page, so that it will reload its system config files. Currently, I'm only worried about Debian; my SA is from the testing (Sarge) distro, and I'm running Apache 1.3. I don't have any other signals to send, or commands, and

performance increase rpm v compile

2005-02-17 Thread tony barratt
Hello, I am working on a python app which does quite a lot of database manipulation via berkeley db. An increase in performance would be welcome, although ait is pretty quick it just has a lot to do. Currently it runs on RH 8.0, FC2 or 3 coming. And it is installed from an (rpm

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Leif B. Kristensen
john san skrev: pure DOS, old pc, used for teaching . want show some windows under DOS (under Python). curses is a text-based interface that will let you build windowed applications like you could with the crt unit in Turbo Pascal of those golden days. I've no idea if anyone's compiled it for

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Leif B. Kristensen
john san skrev: Actually the windows running very good under the xbox-NTOS via xboxmediacenter. its just limited functions(not easy to programming the windows prog.), if we can find WxPython-like can be ported (I can import * from it to my xboxPython) )it will be a great great . You

RE: keeping a COM server alive

2005-02-17 Thread Stefan Schukat
Hi, there is no real solution if you are using a standard local server. The server is as a COM object reference counted. So if the reference count reaches 0 (no client) it will shutdown itself which is done by design. If you want a different behavior you should write either a service which

Re: Pmw.Balloon under Windows

2005-02-17 Thread Eric Brunel
On 16 Feb 2005 10:51:27 -0800, Aki Niimura [EMAIL PROTECTED] wrote: [snip] The software is working fine under Solaris 9. However, when I tried it under Windows, it worked also fine but it spit out the following error message when exiting. (from cygwin terminal) % c:/Python23/python my_app.py This

Re: Stable GUI

2005-02-17 Thread Lars
I've used Tkinter quite extensively for various tools, but never for anything big. I believe it will work nicely for a data input type of application. I don't know if you'll experience significant lag when updating app-windows on old pentiums, but it shouldn't be a problem. Mind you, the machines

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Craig-Wood
Nick Vargish [EMAIL PROTECTED] wrote: I feel pretty much the opposite... If a non-string-type has managed to get into my list-of-strings, then something has gone wrong and I would like to know about this potential problem. This is a good argument. Why not have another method to do this? I

Re: Help with C extensions under VC6 / WinXP and Python 2.4

2005-02-17 Thread Martin v. Löwis
Scott wrote: I'm specifically trying to perform step 6. Creating a brand new project using VC6. The instructions are outdated. Don't use VC6 to build extension modules for Python 2.4. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Max M
Nick Craig-Wood wrote: Nick Vargish [EMAIL PROTECTED] wrote: Why not have another method to do this? I propose joinany which will join any type of object together, not just strings l = [1,2,3,'four'] ','.join(map(str, l)) '1,2,3,four' Is this really that hard to do, that you want it in the

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Michael Hoffman
Nick Craig-Wood wrote: Why not have another method to do this? I propose joinany which will join any type of object together, not just strings I think that's what Frederik was proposing. Except that it would be called join and be a built-in (not a str method). -- Michael Hoffman --

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Michael Hoffman
Max M wrote: ','.join(map(str, l)) '1,2,3,four' Is this really that hard to do, that you want it in the library? I think it's a sufficiently common use case that having to do that is a wart. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Stable GUI

2005-02-17 Thread Jarek Zgoda
Lars napisa(a): The only problem I've ever encountered was with updating Tk widgets from threads in a threaded app - it won't work. The solution was nothing worse than using an output queue, and having an event check the output buffer every second or so. I know literally no GUI toolkit, that

Re: MYSQL - how to install ?

2005-02-17 Thread export
Daniel Bowett wrote: Lad wrote: I am sorry it was my fault I did not say that clearly. I do not have a problem to install MySQL server but I do not know how to install MySQLdb module on my windowsXP so that I can work with MySQL server via Python 2.3. Thanks for help Lad Try

Re: difference between class methods and instance methods

2005-02-17 Thread Duncan Booth
John M. Gabriele wrote: I've done some C++ and Java in the past, and have recently learned a fair amount of Python. One thing I still really don't get though is the difference between class methods and instance methods. I guess I'll try to narrow it down to a few specific questions, but any

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Coghlan
Leo Breebaart wrote: All I've been able to find is a 1999 python-dev post by Tim Peters which would seem to indicate he doesn't understand it either: string.join(seq) doesn't currently convert seq elements to string type, and in my vision it would. At least three of us admit to

Re: MYSQL - how to install ?

2005-02-17 Thread Daniel Bowett
[EMAIL PROTECTED] wrote: Daniel Bowett wrote: Lad wrote: I am sorry it was my fault I did not say that clearly. I do not have a problem to install MySQL server but I do not know how to install MySQLdb module on my windowsXP so that I can work with MySQL server via Python 2.3. Thanks for help Lad

need of help

2005-02-17 Thread Tarik Messaoudi
Hello, Please I need of help about : * how to display an browser window * how to display a window in the midle of the screen and finaly how to insert an image in a canvas within a program -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSQL - how to install ?

2005-02-17 Thread Harlin
Sorry about the mis-read. Keep in mind that if you're doing this on win32 (and it looks like you are), you can use ODBC a bit easier. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: need of help

2005-02-17 Thread Harlin
Need more info on this. Are you: 1. Trying to create a GUI window of your own making? If so, what toolkit are you using? 2. Trying to open a web browser? If so, you can do the following: import os os.system('path/to/executable options') or os.startfile('pagename.html') --

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Harlin
import time play_something() time.sleep(LengthOfSongInSeconds) do_something() Have you tried that? I'd be interesting in seeing this app you have. ! -- http://mail.python.org/mailman/listinfo/python-list

Re: keeping a COM server alive

2005-02-17 Thread [EMAIL PROTECTED]
Hi, thanks, I 'll post the problem in python-win32@python.org ... Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonCard and Py2Exe

2005-02-17 Thread Peter Hansen
[EMAIL PROTECTED] wrote: (Most recent call last): C:\Documents and Settings\Gateway User\ Desktop\custdb\setup.py, line 1, name = custdb, 'setup' is not defined There may be a single word infront of 'setup' on the fourth line, it scramble on my screen because I have to use a screen capture to

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Leif K-Brooks
Leo Breebaart wrote: What I can't find an explanation for is why str.join() doesn't automatically call str() on its arguments I don't really like that idea for the reasons others have stated. But a related and (IMHO) more Pythonic idea would be to allow arbitrary objects to be str.join()ed if

Help needed for to build a CGI shell interface.

2005-02-17 Thread Slalomsk8er
I don't get it with the popen (popen3 or subprocess). 1. How do I establish my pipes? 2. And how do I interact with the pipes (interactive CGI-page)? Thanks, Dominik -- http://mail.python.org/mailman/listinfo/python-list

Re: gui scripting

2005-02-17 Thread Tonino
hi, thanks - am already involved in a process to modify winguiauto.py - this is a GREAT start but we need more control and better handleing ;) Thanks for the WATSUP site - will check on this as well ;) Thanks T -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Lucas Raab
Leif B. Kristensen wrote: john san skrev: Actually the windows running very good under the xbox-NTOS via xboxmediacenter. its just limited functions(not easy to programming the windows prog.), if we can find WxPython-like can be ported (I can import * from it to my xboxPython) )it will be a

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Vargish
news.sydney.pipenetworks.com [EMAIL PROTECTED] writes: Really ? Then why are you using python. Try import this at a Python prompt. I didn't invent Explicit is better than implicit. Python or most dynamic languages are are so great because of their common sense towards the implicit. Python

Re: Stable GUI + wxPython memory leak

2005-02-17 Thread Viktor
Peter Hansen wrote: On which platform? On Linux, and I'm watching the percentage of used memory with *top* or *ps v* (I have 256 MB). The aplication started with 19% used and after 45 minutes playing I saw i eat up almost 70%. I also noticed that: from Tkinter import * l = Listbox()

Re: Help needed for to build a CGI shell interface.

2005-02-17 Thread Diez B. Roggisch
Slalomsk8er wrote: I don't get it with the popen (popen3 or subprocess). 1. How do I establish my pipes? 2. And how do I interact with the pipes (interactive CGI-page)? There are plenty of python + http frameworks out there - from simple cgi-like ones like mod_python to full fledged app

tiff via email-module

2005-02-17 Thread Arenz, Ralph
hi all, my problem is to get a tiff-file-attachment out of an email sent by a fax-server. When i try this with get_payload(decode='True') i get additional informations, looks like binary-mixed header-information, enveloping the tiff-data. I tried the following: Sending the email from outlook

Re: Stable GUI + wxPython memory leak

2005-02-17 Thread Fredrik Lundh
Viktor wrote: Doesn't free the memory. The memory stays occupied. OK, when I do the same thing again, no additional memory is occupied. He uses the same memory allocated first time, but why doesn't he free it and why memory isn't fread up even if I explicitly call the memory is released, but

Is it possible to use the logging-module in a threadless environment?

2005-02-17 Thread Roger
I'd like to use a program (roundup) that imports the logging.config module on a machine where I could not get the thread and threading modules to compile. How dangerous is it to changing /lib/python2.4/logging/config.py to something like: import dummy_thread as thread, dummy_threading as

Re: check if object is number

2005-02-17 Thread TZOTZIOY
On Sat, 12 Feb 2005 16:01:26 -0800, rumours say that Michael Spencer [EMAIL PROTECTED] might have written: Yup, that's basically what I'm doing right now. The question was really how to define that adapter function. =) Steve OK - then my entry is: assert obj+1 = 1 :-) So -1 is not

Re: Why Tk treat F10, F11, F12 diferently from F1...F9?

2005-02-17 Thread TZOTZIOY
On Sun, 13 Feb 2005 00:10:35 -0200, rumours say that Gabriel B. [EMAIL PROTECTED] might have written: [snip: F10 in Motif activates the menu bar] i'm on windowsXP (what makes the F10 biding by default even more weird). Well, for now using the keysym_num will be more safe since i'm still getting

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread news.sydney.pipenetworks.com
Fredrik Lundh wrote: news.sydney.pipenetworks.com wrote: Nick Explicit is better than Implicit Really ? Then why are you using python. Python or most dynamic languages are are so great because of their common sense towards the implicit. You must have heard of never say never but never say

Re: Stable GUI + wxPython memory leak

2005-02-17 Thread Sion Arrowsmith
Peter Hansen [EMAIL PROTECTED] wrote: Viktor wrote: I just noticed that wxPython is leaking memory?! Playing with wxPython-demo, I started with 19MB used, and ended whith almost 150MB used?! It's wxPython 2.5.3.1 running on Python 2.4. On which platform? And how are you measuring this

Convert a raw pointer to IDispatch

2005-02-17 Thread Roger That
Hi, I am trying to use the function CreateStreamOnHGlobal from python code (I need to pass an IStream object to MSXML, like I do in C++ code). I was able to retrieve a pointer on the IStream object in this way: from ctypes import * stream = c_int() windll.ole32.CreateStreamOnHGlobal(c_long(0),

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Fuzzyman
john san wrote: Actually the windows running very good under the xbox-NTOS via xboxmediacenter. its just limited functions(not easy to programming the windows prog.), if we can find WxPython-like can be ported (I can import * from it to my xboxPython) )it will be a great great . You

Re: pyFMOD writing a callback function in Python

2005-02-17 Thread kdahlhaus
Any opinion on pyFMOD vs. pySonic? -- http://mail.python.org/mailman/listinfo/python-list

Re: Stable GUI

2005-02-17 Thread Thomas Guettler
Am Wed, 16 Feb 2005 06:19:27 -0800 schrieb Viktor: Which GUI is the most stable one? I don't need any fancy looking widgets (look and feel doesn't realy matter to me), I just need it to be rock stable and fast... Hi, For me pygtk is enough stable and fast. The reference is good:

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread news.sydney.pipenetworks.com
Nick Vargish wrote: news.sydney.pipenetworks.com [EMAIL PROTECTED] writes: Really ? Then why are you using python. Try import this at a Python prompt. I didn't invent Explicit is better than implicit. Thanks for the pointer. Let's see how many zen points are for the OP's idea vs against

os.walk()

2005-02-17 Thread rbt
Could someone demonstrate the correct/proper way to use os.walk() to skip certain files and folders while walking a specified path? I've read the module docs and googled to no avail and posted here about other os.walk issues, but I think I need to back up to the basics or find another tool as

Re: os.walk()

2005-02-17 Thread Dan Perl
rbt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Could someone demonstrate the correct/proper way to use os.walk() to skip certain files and folders while walking a specified path? I've read the module docs and googled to no avail and posted here about other os.walk issues,

Re: Is it possible to use the logging-module in a threadless environment?

2005-02-17 Thread Denis S. Otkidach
On 17 Feb 2005 05:41:12 -0800 [EMAIL PROTECTED] (Roger) wrote: I'd like to use a program (roundup) that imports the logging.config module on a machine where I could not get the thread and threading modules to compile. How dangerous is it to changing /lib/python2.4/logging/config.py to

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Coghlan
news.sydney.pipenetworks.com wrote: Nick Vargish wrote: news.sydney.pipenetworks.com [EMAIL PROTECTED] writes: Really ? Then why are you using python. Try import this at a Python prompt. I didn't invent Explicit is better than implicit. Thanks for the pointer. Let's see how many zen points are

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Sion Arrowsmith
In article [EMAIL PROTECTED], ! Nick Vargish [EMAIL PROTECTED] wrote: If a non-string-type has managed to get into my list-of-strings, then something has gone wrong and I would like to know about this potential problem. Thinking about where I use join(), I agree. If there's something other

Re: os.walk()

2005-02-17 Thread rbt
Roel Schroeven wrote: rbt wrote: The problem I run into is that some of the files and dirs are not removed while others are. I can be more specific and give exact examples if needed. On WinXP, 'pagefile.sys' is always removed, while 'UsrClass.dat' is *never* removed, etc. Keep in mind that the

Re: os.walk()

2005-02-17 Thread Max Erickson
snip os.walk() is a generator. When you iterate over it, like in a for loop, as for r,ds,fs in os.walk(...): r, ds and fs are set to new values at the beginning of each iteration. If you want to end up with a list of files or dirs, rather than processing them in the bodies of the file and dir for

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread john san
oh, ya. Fuzzyman [EMAIL PROTECTED] news:[EMAIL PROTECTED] john san wrote: Actually the windows running very good under the xbox-NTOS via xboxmediacenter. its just limited functions(not easy to programming the windows prog.), if we can find WxPython-like can be ported (I can import

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Duncan Booth
news.sydney.pipenetworks.com wrote: I'm not sure if this has been raised in the thread but I sure as heck always convert my join arguments using str(). When does someone use .join() and not want all arguments to be strings ? Any examples ? This has already been raised, but maybe not in

Re: Getting milliseconds in Python

2005-02-17 Thread Curt
On 2005-02-16, Brian Beck [EMAIL PROTECTED] wrote: seconds * 100 = milliseconds are you sure you know what a millisecond is? (duck) Touché. But it was a typo. Oh, you meant 'seconds / 100 = milliseconds'? (canard) -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread john san
yes. u need mod-xbox. since its be easy done and we already have OS, Python support what we need now is only that Python can easy to coding and show window program just like wt we can do under Windows. Lucas Raab [EMAIL PROTECTED] news:[EMAIL PROTECTED] Leif B. Kristensen wrote: john san

Re: Getting milliseconds in Python

2005-02-17 Thread Brian Beck
Curt wrote: Oh, you meant 'seconds / 100 = milliseconds'? (canard) I assume you're suggesting that there are two typos in my original post (the * and the 100)... Despite a millisecond being a thousandth of a second, given the number of seconds provided by the time module, he does have to

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Diez B. Roggisch
john san wrote: yes. u need mod-xbox. since its be easy done and we already have OS, Python support what we need now is only that Python can easy to coding and show window program just like wt we can do under Windows. You can't. DOS does not allow for graphical output - at least not in a way

Re: tiff via email-module

2005-02-17 Thread Max M
Arenz, Ralph wrote: hi all, my problem is to get a tiff-file-attachment out of an email sent by a fax-server. When i try this with get_payload(decode='True') i get additional informations, looks like binary-mixed header-information, enveloping the tiff-data. get_payload(decode=1) returns the

Re: Problem using/installing numarray

2005-02-17 Thread maxwell
Thanks, that explains why the CygWin Python will not import the .pyd files: imp.get_suffixes() [('.dll', 'rb', 3), ('module.dll', 'rb', 3), ('.py', 'U', 1), ('.pyc', 'rb', 2)] Doesn't look like there's a way to get the CygWin Python to load .pyd files. So I guess I have to figure out why the

Re: difference between class methods and instance methods

2005-02-17 Thread John
Duncan Booth wrote: John M. Gabriele wrote: I've done some C++ and Java in the past, and have recently learned a fair amount of Python. One thing I still really don't get though is the difference between class methods and instance methods. I guess I'll try to narrow it down to a few specific

Re: difference between class methods and instance methods

2005-02-17 Thread Diez B. Roggisch
John wrote: ... hmm... bound methods get created each time you make a call to an instance method via an instance of the given class? No, they get created when you create an actual instance of an object. So only at construction time. Creating them means taking the unbound method and binding the

Re: Getting milliseconds in Python

2005-02-17 Thread Brian Beck
Martin Christensen wrote: A math teacher! A math teacher! My kingdom for a math teacher! Martin Man, this is the hottest topic on c.l.py since that Lazaridis guy... -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

site indexer and search script

2005-02-17 Thread flupke
Hi, for an old intranet that is still used here, i would like to add a search function. I think there migth already be an indexer/search script available in python. I've googled and come across a few scripts but i'm not sure which one is really easy and good at the task. Any good scripts (and

Re: difference between class methods and instance methods

2005-02-17 Thread John
Diez B. Roggisch wrote: John wrote: ... hmm... bound methods get created each time you make a call to an instance method via an instance of the given class? No, they get created when you create an actual instance of an object. So only at construction time. Creating them means taking the unbound

Re: difference between class methods and instance methods

2005-02-17 Thread Diez B. Roggisch
O. Unlike C++, where methods are not first class objects and you only have *one* that gets shared by all instances. Exactly - so unlike in c++, where you have to do ugly hacks if e.g. a C-lib takes a callback and you want to pass an instance method, you can do that in python. It's

Re: newbie question - iterating through dictionary object

2005-02-17 Thread Martin Christensen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Miranda == mirandacascade [EMAIL PROTECTED] writes: Miranda 1) Is there any advantage to use the Miranda y = a.keys() Miranda for z in y: While you're at it, you could save y altogether and just use for z in a.keys(): ... Miranda looping

Re: Getting milliseconds in Python

2005-02-17 Thread Martin Christensen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian == Brian Beck [EMAIL PROTECTED] writes: Brian Man, this is the hottest topic on c.l.py since that Lazaridis Brian guy... ... which was really the point of my joke, even if it did belly flop somewhat. This whole discussions brought to mind a

Re: difference between class methods and instance methods

2005-02-17 Thread Steven Bethard
John wrote: Steven Bethard wrote: John M. Gabriele wrote: class C(object): @classmethod def f(cls, *args): # do stuff Sorry -- I'm not as far along as you suspect. :) I've never yet seen this @classmethod syntax. I'm supposing that it's part of this so-called new-style class

Re: newbie question - iterating through dictionary object

2005-02-17 Thread Grant Edwards
On 2005-02-17, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 1) Is there any advantage to use the y = a.keys() for z in y: looping technique rather than the for x in a: looping technique? Not really. 2) What are the tradeoffs for using each of the techniques? for x in a can be more

Re: Loading functions from a file during run-time

2005-02-17 Thread Wensheng
f=open(bar.txt) import imp fs=imp.new_module(fs) exec f in fs.__dict__ rests are the same althought why use anything other than .py, when you import .py, it get compiled into .pyc and it load faster next time -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question - iterating through dictionary object

2005-02-17 Thread Steven Bethard
[EMAIL PROTECTED] wrote: 1) Is there any advantage to use the y = a.keys() for z in y: looping technique rather than the for x in a: looping technique? 2) What are the tradeoffs for using each of the techniques? Calling dict.keys creates a list in memory of the keys to the dict. Using the dict

Re: newbie question - iterating through dictionary object

2005-02-17 Thread Steven Bethard
Grant Edwards wrote: Here's another choice, that's sometimes handy: d = {1:'one',2:'two',3:'three'} for k,v in d.items(): print k,v 1 one 2 two 3 three I wouldn't recommend this for large dictionaries. Yes, for large dictionaries, you should use: for k, v in d.iteritems(): print

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Simon John
I don't think time.sleep() will work too well, I think it will cause the program to hang around in the foreground, and prevent the GUI updating. I'll give it a try just to make sure, as I can't figure out the signal/alarm thing (the alarm only seems to trigger when I click a button, not after

Creating properties with decorator like syntax

2005-02-17 Thread Will McGugan
Hi, Is there any way of making properties using a decorator? The current way of creating a property seems inelegant. Something like this imaginary snippit would be nice, IMHO. class C(object): @make_property def x(self): def getx(self): return self.__x def

Re: difference between class methods and instance methods

2005-02-17 Thread Duncan Booth
Diez B. Roggisch wrote: John wrote: ... hmm... bound methods get created each time you make a call to an instance method via an instance of the given class? No, they get created when you create an actual instance of an object. So only at construction time. Creating them means taking the

Re: Help needed for to build a CGI shell interface.

2005-02-17 Thread Slalomsk8er
Diez B. Roggisch wrote: Slalomsk8er wrote: I don't get it with the popen (popen3 or subprocess). 1. How do I establish my pipes? 2. And how do I interact with the pipes (interactive CGI-page)? There are plenty of python + http frameworks out there - from simple cgi-like ones like mod_python to

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Simon John
Damn! signal is not supported on Windows. time.sleep() doesn't work, as I suspected:: def info(self): sleep(5) self.info() Basically causes the function to pause, then call itself again, all in the foreground :-( I'm thinking some sort of thread timer is the way to go, but really don't

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Jeff Shannon
news.sydney.pipenetworks.com wrote: Fredrik Lundh wrote: a certain princess bride quote would fit here, I think. I'm not really familiar with it, can you enlighten please. (Taking a guess at which quote /F had in mind...) Vezzini: Inconceivable! Inigo:You keep using that word. I do not think

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-17 Thread Ilias Lazaridis
Stephen Kellett wrote: [...] closing thread http://groups-beta.google.com/group/comp.lang.python/msg/f2ae9cdbe16676d1 . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-17 Thread Ilias Lazaridis
Mike Meyer wrote: [...] closing thread http://groups-beta.google.com/group/comp.lang.python/msg/f2ae9cdbe16676d1 . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-17 Thread Ilias Lazaridis
Bruno Desthuilliers wrote: [...] closing thread http://groups-beta.google.com/group/comp.lang.python/msg/f2ae9cdbe16676d1 . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list

Re: multimethod (or rather overloading) in Python

2005-02-17 Thread anton muhin
anton muhin wrote: Correction: Of course, I can imagine some metaclasses magic that would allow to code: class MyClass(WithOverloading): @overloadMethod(A) def someMetod(self, _): ... But it would rather convoluted: the best idea I have so far is to mangle methods name in the manner most of

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-17 Thread Ilias Lazaridis
Peter Maas wrote: Ilias Lazaridis schrieb: I'm a newcomer to python: Sorry, I'm breaking my promise to post only once to this thread. I'm breaking my 'promise' to close this thread. But I've found the ultimate recipe to resolve all issues of this and other similar threads: Please read

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Jeff Shannon
Simon John wrote: I'm writing a PyQt network client for XMMS, using the InetCtrl plugin, that on connection receives a track length. [...] So, how would I make a Python program automatically call a function after a preset period of time, without the Python process running in the foreground

Re: Calling a function from module question.

2005-02-17 Thread JRCondon
Sean, if you are asking what I think you are asking (I don't think name hiding is the issue), you can use from module_name import * and you will end up with all of the functions at session scope. You can use the 'as' to alias the function names if you wish from module_name import fn1 as myfn1,

Re: Alternative to standard C for

2005-02-17 Thread James Stroud
On Sat, 2005-02-05 at 10:49, BJörn Lindqvist wrote: I am quite new to Python, and have a straight simple question. In C, there is for (init; cond; advance). We all know that. In Python there are two ways to loop over i=A..B (numerical.): 1) i = A while iB: ...do something...

Re: Convert a raw pointer to IDispatch

2005-02-17 Thread Thomas Heller
Roger That [EMAIL PROTECTED] writes: Hi, I am trying to use the function CreateStreamOnHGlobal from python code (I need to pass an IStream object to MSXML, like I do in C++ code). I was able to retrieve a pointer on the IStream object in this way: from ctypes import * stream = c_int()

namespace collisions

2005-02-17 Thread Will McGugan
Hi, I'm accumulating a number of small functions, which I have sensibly put in a single file called 'util.py'. But it occurs to me that with such a generic name it could cause problems with other modules not written by myself. Whats the best way of handling this? If I put it in a common

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Thomas Heller
Diez B. Roggisch [EMAIL PROTECTED] writes: Maybe somehow the pygame sdl wrapper can be used for gui-stuff. SDL has had a DOS mode. But it is discontinued. What exactly is discontinued? pygame? SDL? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: check if object is number

2005-02-17 Thread Michael Spencer
Christos TZOTZIOY Georgiou wrote: On Sat, 12 Feb 2005 16:01:26 -0800, rumours say that Michael Spencer [EMAIL PROTECTED] might have written: Yup, that's basically what I'm doing right now. The question was really how to define that adapter function. =) Steve OK - then my entry is:

msnp, friends list

2005-02-17 Thread jr
I'm currently using the msnp.py code from Manish Jethani's project. I havn't been able to get the friends list to update like it should. it works once out of about every 25 times the program loads. Has anyone been able to implement his code and get the friends list to actively update? Or have any

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Jeff Shannon
Leif B. Kristensen wrote: john san skrev: pure DOS, old pc, used for teaching . want show some windows under DOS (under Python). curses is a text-based interface that will let you build windowed applications like you could with the crt unit in Turbo Pascal of those golden days. I've no idea if

  1   2   >