Re: Copying data between file-like objects

2005-02-16 Thread Fredrik Lundh
Thomas Lotze wrote: >> if you don't know how large f2 can be, use shutil.copyfileobj: >> >> >>> help(shutil.copyfileobj) >> Help on function copyfileobj in module shutil: >> >> copyfileobj(fsrc, fdst, length=16384) >> copy data from file-like object fsrc to file-like object fds

Re: check if object is number

2005-02-16 Thread Fredrik Lundh
Steven Bethard wrote: >> Actually no, floats don't meet this behaviour or more specifically >> floats don't guarantee this behaviour. It depends of course on >> your implementation of f, but it is possible with floats to keep >> incrementing and never reach a maximum. > > My code won't hit this co

How new Check 21 legislation is affecting you...

2005-02-16 Thread Cathleen Baer
Good Afternoon! Recenty intrdocuced legislation requires business and home users to print personal and business checks with security blank check stock and magnetic ink. Please find qualified suppliers at Google by clicking on the followingl link. http://www.google.com/search?sourceid=navclient&i

Re: "perl -p -i -e" trick in Python?

2005-02-16 Thread TZOTZIOY
On Wed, 16 Feb 2005 01:44:40 -0500, rumours say that Jack Diederich <[EMAIL PROTECTED]> might have written: >/tmp/> python >Python 2.3.4 (#2, Jan 5 2005, 08:24:51) >Type "help", "copyright", "credits" or "license" for more information. ^D "Instant porting of any program to python". Smooth

Re: Copying data between file-like objects

2005-02-16 Thread Thomas Lotze
Fredrik Lundh wrote: > copyfileobj copies from the current location, and write leaves the file > pointer at the end of the file. a s.seek(0) before the copy fixes that. Damn, this cannot be read from the documentation, and combined with the fact that there's no length parameter for a portion to

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

2005-02-16 Thread Peter Maas
Michael Hoffman schrieb: Ilias Lazaridis wrote: But don't act like the volunteers who develop Python owe you a version of Python that runs out of the box on MinGW. They don't, anymore than you owe *me* a version of Python that runs out of the box on MinGW. Please, leave him alone. When he posted he

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

2005-02-16 Thread Peter Maas
Ilias Lazaridis schrieb: I'm a newcomer to python: Sorry, I'm breaking my promise to post only once to this thread. But I've found the ultimate recipe to resolve all issues of this and other similar threads: Please read http://nobelprize.org/medicine/educational/pavlov/ and then do something useful

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

2005-02-16 Thread Fuzzyman
Hans Nowak built some old DOS binaries... although I believe on his website he points to a more 'modern' projects. Sorry - restricted internet or I would check for you. Try http://zephyrfalcon.org Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/l

Re: "perl -p -i -e" trick in Python?

2005-02-16 Thread Miki Tebeka
Hello Wonjae, > I read the comment of > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277753. > (Title : Find and replace string in all files in a directory) > > "perl -p -i -e 's/change this/..to this/g'" trick looks handy. > Does Python have a similar trick? Or, is there a shorter Pyt

Re: super not working in __del__ ?

2005-02-16 Thread Duncan Booth
Fredrik Lundh wrote: > in this case, > > def __del__(self): > super(self.__class__, self).__del__() > > should do the trick. Only if nobody ever tries to subclass your class, and if they aren't going to subclass it why bother to use super in the first place. >>> class Base(object):

Re: problem: reducing comparison

2005-02-16 Thread Xah Lee
©someone sent me the following code, which performs identically with the original reduce. (tested for pairings of comb(n) with large n) Superb. © ©def reduce2( pairings, pair ): ©result={} ©for i,j in pairings.itervalues(): ©if i in pair: i=pair[0] ©if j in pair: j=pair[0] ©

Re: pyFMOD writing a callback function in Python

2005-02-16 Thread Marian Aldenhövel
Hi, Check out pySonic, a new FMOD wrapper written with Pyrex. Much more Pythonic. I have only found Win32-Downloads. The same is true for pyFMOD. What options do I have to make it work on Linux? Ciao, MM -- Marian Aldenhövel, Rosenhain 23, 53123 Bonn. +49 228 624013. http://www.marian-aldenhoevel.d

Re: Variables.

2005-02-16 Thread administrata
sry, I mean the problem is... about lining it doesn't look like this... Allen woke up early in the morning. But, it was unusal by Allen. Allen's pillow was with Allen. Allen didn't want to wake up But, Allen tried my best and woke up. it was so amazing -- http://mail.python.org/mailman/listinfo/

Re: super not working in __del__ ?

2005-02-16 Thread Ola Natvig
Duncan Booth wrote: Fredrik Lundh wrote: in this case, def __del__(self): super(self.__class__, self).__del__() should do the trick. Only if nobody ever tries to subclass your class, and if they aren't going to subclass it why bother to use super in the first place. class Base(object): de

MYSQL - how to install ?

2005-02-16 Thread Lad
I use XP windows and Python 2.3. How can I install MYSQL on my computer? I could not find any installer for MYSQL and Python 2.3 Thanks for help Lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Duncan Booth
Ola Natvig wrote: >> def __del__(self): > > There should be a super(self.__class__, self)._del__() here if I'm not > totaly wong, which could be the case here ;) > > >> print "Base.__del__" >> >> > There was one, but for some reason you trimmed it out of your quote

Re: Variables.

2005-02-16 Thread Robert Kern
administrata wrote: sry, I mean the problem is... about lining it doesn't look like this... Allen woke up early in the morning. But, it was unusal by Allen. Allen's pillow was with Allen. Allen didn't want to wake up But, Allen tried my best and woke up. it was so amazing In the future, please foll

Re: [ANN] IPython 0.6.11 is out.

2005-02-16 Thread Ville Vainio
Warning - if you are upgrading and have an old pysh.py dangling around in $HOME/.ipython, be sure to delete it. The old version is incompatible with the new ipython. -- Ville Vainio http://tinyurl.com/2prnb -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSQL - how to install ?

2005-02-16 Thread Daniel Bowett
Download MySQL for windows at: http://www.mysql.com Then: http://www.google.co.uk/search?hl=en&q=python+mysql&btnG=Google+Search&meta= Lad wrote: I use XP windows and Python 2.3. How can I install MYSQL on my computer? I could not find any installer for MYSQL and Python 2.3 Thanks for help Lad. --

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

2005-02-16 Thread Daniel Bowett
john san wrote: How to install python under DOS and is there any Wxpython-like can be installed under dos? Thanks. Are you actually still running a pure DOS machine? Or are you running the dos prompt through Windows? -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] problem: reducing comparison

2005-02-16 Thread Michael Hoffman
Xah Lee wrote: attached below is the Perl documentation that i wrote for a function called "reduce", which is really the heart of a larger software. Don't shadow built-ins. Especially for a function name. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSQL - how to install ?

2005-02-16 Thread Harlin
For MySQL on windows go here: http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-4.1.10-win32.zip/from/pick#mirrors For Python 2.3.5 binary installer for win32: http://www.python.org/ftp/python/2.3.5/Python-2.3.5.exe -- 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-16 Thread Harlin
Any reason you're asking about wxPython for "DOS"? Just curious. -- http://mail.python.org/mailman/listinfo/python-list

Re: some qustions on python

2005-02-16 Thread Harlin
Can you be a bit more specific about what you're wanting? A design process will be very similar across languages no matter which language it is. If you'd like a "small evaluation" of Python you're best served by reading the official summary: http://www.python.org/doc/Summary.html Else you'll alwa

Re: super not working in __del__ ?

2005-02-16 Thread Brian Beck
Duncan Booth wrote: There was one, but for some reason you trimmed it out of your quote: The original code before you trimmed it was: Look carefully, he was commenting on the contents of class Base (which does omit the line he suggests), not class B. Whether he's correct or not, I'm not wizardly

Re: Compiler

2005-02-16 Thread Harlin
Easy, easy... Use py2exe: http://starship.python.net/crew/theller/py2exe/ -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Duncan Booth
Ola Natvig wrote: > Duncan Booth wrote: >class Base(object): >> >> def __del__(self): > > There should be a super(self.__class__, self)._del__() here if I'm not > totaly wong, which could be the case here ;) > > >> print "Base.__del__" >> >> > Thanks to Brian Be

"Architecture of Python" restored! [was Re: "Architecture of Python" was removed ?]

2005-02-16 Thread Gerrit Muller
Jim Jackson's UIUC email address is/was [EMAIL PROTECTED] Jim, if you're out there, is it okay to reconstruct your old C427 assignment somewhere else? The original pages at appear to be restored completely, including the nice visualizations! thanks, Gerrit

[ANN] Data Plotting Library DISLIN 8.3

2005-02-16 Thread Helmut Michels
I am pleased to announce version 8.3 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as X11, VGA, PostScript,

Re: low-end persistence strategies?

2005-02-16 Thread Thomas Guettler
Am Tue, 15 Feb 2005 18:57:47 -0800 schrieb Paul Rubin: > I've started a few threads before on object persistence in medium to > high end server apps. This one is about low end apps, for example, a > simple cgi on a personal web site that might get a dozen hits a day. > The idea is you just want t

Re: low-end persistence strategies?

2005-02-16 Thread Diez B. Roggisch
Maybe ZODB helps. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

supress creation of .pyc files

2005-02-16 Thread Thomas Guettler
Hi, Is there a way to import a file without creating a .pyc file? Of course you can delete the pyc in my script after the import statement, but maybe there is a switch that I have not found yet. The imported file is a config file, not a script. Thomas -- Thomas Güttler, http://www.thomas-gue

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > Maybe ZODB helps. I think it's way too heavyweight for what I'm envisioning, but I haven't used it yet. I'm less concerned about object persistence (just saving strings is good enough) than finding the simplest possible approach to dealing with co

Re: supress creation of .pyc files

2005-02-16 Thread Jeremy Sanders
On Wed, 16 Feb 2005 14:53:22 +0100, Thomas Guettler wrote: > The imported file is a config file, not a script. You could use execfile() to read the file, and not import. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSQL - how to install ?

2005-02-16 Thread Lad
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 -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> Maybe ZODB helps. > > I think it's way too heavyweight for what I'm envisioning, but I > haven't used it yet. I'm less concerned about object persistence > (just saving strings is good enough) than finding the simplest > possi

Stable GUI

2005-02-16 Thread 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... -- http://mail.python.org/mailman/listinfo/python-list

Re: MYSQL - how to install ?

2005-02-16 Thread Daniel Bowett
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 this installer, if you want a newer versi

Re: Stable GUI

2005-02-16 Thread Lars
Hi Viktor, By fast what do you mean exactly? Imho all the usual gui-toolkits pythonistas use are quite fast enough for most applications. You can use Tkinter ofcourse, and with the extra "Tix" module you get lots widgets. It's not the prettiest toolkit in the world, but it does the job well. And

adding new functionality to a function non-intrusively!

2005-02-16 Thread peter
Hello all, Recently I've started to refactor my code ... I would like to add extra functionality to a function !non-intrusively! (not rewriting the old code is really important) How can I achieve this? Thus I start with an old function named fA. I would like to add extra functionality to fA. Esse

Re: Stable GUI

2005-02-16 Thread Birdman
Check out EasyGui. It's easy to use/modify Tinker: http://www.ferg.org/easygui/ >From the web page: " Experienced Pythonistas need support for quick and dirty GUI features. New Python programmers need GUI capabilities that don't require any knowledge of Tkinter, frames, widgets, callbacks or lamb

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > I think it's way too heavyweight for what I'm envisioning, but I > > haven't used it yet. I'm less concerned about object persistence > > (just saving strings is good enough) than finding the simplest > > possible approach to dealing with concurre

Getting milliseconds in Python

2005-02-16 Thread mjs7231
I am trying to record how long an operation takes, but can't seem to find a function that will allow me to record the timestamp in milliseconds, maybe I am looking in the wrong place? -- http://mail.python.org/mailman/listinfo/python-list

RE: Getting milliseconds in Python

2005-02-16 Thread Batista, Facundo
Title: RE: Getting milliseconds in Python [mjs7231] #- I am trying to record how long an operation takes, but can't seem to #- find a function that will allow me to record the timestamp in #- milliseconds, maybe I am looking in the wrong place? Use time.time(). >>> import time >>> def f(

renaming 'references' to functions can give recursive problems

2005-02-16 Thread peter
Hello all, Recently I've started to refactor my code ...(I'm using python 2.3.4) I tried to add extra functionality to old functions non-intrusively. When I used a construct, which involves renaming functions etc... I came across some recursive problems. (a basic construct can be found under the

Re: adding new functionality to a function non-intrusively!

2005-02-16 Thread mjs7231
Whenever I want to add functionality to a function while still allowing it to word as it was before my edit would be to include a few optional variables passed to the string. something to this effect would look like: -- BEFORE: -

Re: low-end persistence strategies?

2005-02-16 Thread Diez B. Roggisch
> The issue with using an rdbms is not with the small amount of code > needed to connect to it and query it, but in the overhead of Its not only connecting - its creating (automaticall if necessary) and "connecting" which is actually only opening. > installing the huge piece of software (the rdbm

Re: Getting milliseconds in Python

2005-02-16 Thread Diez B. Roggisch
mjs7231 wrote: > I am trying to record how long an operation takes, but can't seem to > find a function that will allow me to record the timestamp in > milliseconds, maybe I am looking in the wrong place? I have no idea where you look - but the time-module has IMHO a descriptive enough name - so

Re: low-end persistence strategies?

2005-02-16 Thread Tom Willis
Sounds like you want pickle or cpickle. On Tue, 15 Feb 2005 19:00:31 -0800 (PST), Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > I've started a few threads before on object persistence in medium to > high end server apps. This one is about low end apps, for example, a > simple cgi on a pe

KWF delivery failure notification

2005-02-16 Thread KWF6
KWF was unable to deliver message. Remote server's reply: 550 Message rejected: virus found. (Worm.SomeFool.P) Message headers follow: From: python-list@python.org To: [EMAIL PROTECTED] Subject: Re: Message Date: Tue, 15 Feb 2005 17:04:55 +0500 MIME-Version: 1.0 Content-Type: multipart/mi

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > It has to be installed. And it has C-modules - but I don't see that > as a problem. Of course this is my personal opinion - but it's > certainly easier installed than to cough up your own transaction > isolated persistence layer. I started using it

Re: adding new functionality to a function non-intrusively!

2005-02-16 Thread Michele Simionato
Decorators are your friends. You can wrap a function and give it additional functionality. For instance just yesterday I needed to keep track of how many times a function is called. This can be done with this decorator: .def with_counter(f): .def wrappedf(*args, **kw): .wrappedf.counte

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
Tom Willis <[EMAIL PROTECTED]> writes: > Sounds like you want pickle or cpickle. No, the issue is how to handle multiple clients trying to update the pickle simultaneously. -- http://mail.python.org/mailman/listinfo/python-list

Re: adding new functionality to a function non-intrusively!

2005-02-16 Thread peter
Hello I indeed also rely on your idea. My problem however is: is has to be non-intrusively in both ways. In your example, it would indeed not break the old code which relies on myfunction but my problems is: I also do not want to change the code of the 'before' myfunction. so my problem in fact

Test for structure

2005-02-16 Thread alex
Hi there, how can I check if a variable is a structure (i.e. a list)? For my special problem the variable is either a character string OR a list of character strings line ['word1', 'word2',...] So how can I test if a variable 'a' is either a single character string or a list? I tried: if a is li

Re: low-end persistence strategies?

2005-02-16 Thread Chris Cioffi
I'd like to second this one...ZODB is *extremely* easy to use. I use it in projects with anything from a couple dozen simple objects all the way up to a moderately complex system with several hundred thousand stored custom objects. (I would use it for very complex systems as well, but I'm not wor

Re: Test for structure

2005-02-16 Thread Simon Brunning
On Wed, 16 Feb 2005 07:11:08 -0800 (PST), alex <[EMAIL PROTECTED]> wrote: > how can I check if a variable is a structure (i.e. a list)? For my > special problem the variable is either a character string OR a list of > character strings line ['word1', 'word2',...] > > So how can I test if a variabl

Re: Test for structure

2005-02-16 Thread Chris Cioffi
Perhaps you're looking for the type() built in function and the types modules? >>> type('aaa') >>> type([]) >>> import types >>> if type([]) is types.ListType: ... print 'is a list' ... is a list Chris On Wed, 16 Feb 2005 07:10:56 -0800 (PST), alex <[EMAIL PROTECTED]> wrote: > Hi ther

Re: Test for structure

2005-02-16 Thread Diez B. Roggisch
import types v = [] if type(v) is types.ListType: pass -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: adding new functionality to a function non-intrusively!

2005-02-16 Thread peter
thx a lot for the information on decorators this will be very usefull... (sounds like a little step towards aspect orientated programming,:) ) Because I use libraries which rely on boost-python I can not jump into python 2.4 but I understand the main idea and can also use it in python 2.3 (it w

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread peter
see the topic: adding new functionality to a function non-intrusively! and decorators if you want to add functionality to a function! -- http://mail.python.org/mailman/listinfo/python-list

ZODB performance (was Re: low-end persistence strategies?)

2005-02-16 Thread Dave Brueck
Chris Cioffi wrote: I'd like to second this one...ZODB is *extremely* easy to use. I use it in projects with anything from a couple dozen simple objects all the way up to a moderately complex system with several hundred thousand stored custom objects. (I would use it for very complex systems as w

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Antoon Pardon
Op 2005-02-16, peter schreef <[EMAIL PROTECTED]>: > Hello all, > > Recently I've started to refactor my code ...(I'm using python 2.3.4) > I tried to add extra functionality to old functions non-intrusively. > When I used a construct, which involves renaming functions etc... I > came across some re

Working With Forms

2005-02-16 Thread yuba
Hello- I have been asked to design a routine to query a database and write the results out in a way that will fit on a specified form. I think it would be better if I could work with the form and overlay the data in Python, then either write it out to a file or print it. I have worked with the r

Re: Stable GUI

2005-02-16 Thread Viktor
Lars wrote: > Maybe you should describe your particular application and the reasons > why you really need lightspeed widget rendering ? Stability goes > without saying:) It's a GUI for some database input, output routines. It sopouse to wark 24h/day, and about 150 input-outputs/h. Fast: Because i

Re: low-end persistence strategies?

2005-02-16 Thread Tom Willis
Oops missed that sorry. Carry on. On Wed, 16 Feb 2005 07:29:58 -0800 (PST), Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Tom Willis <[EMAIL PROTECTED]> writes: > > Sounds like you want pickle or cpickle. > > No, the issue is how to handle multiple clients trying to update the > pickle si

Re: low-end persistence strategies?

2005-02-16 Thread Michele Simionato
What about bsddb? On most Unix systems it should be already installed and on Windows it comes with the ActiveState distribution of Python, so it should fullfill your requirements. -- http://mail.python.org/mailman/listinfo/python-list

more os.walk() issues... probably user error

2005-02-16 Thread rbt
This function is intended to remove unwanted files and dirs from os.walk(). It will return correctly *IF* I leave the 'for fs in fs_objects' statement out (basically leave out the entire purpose of the function). It's odd, when the program goes into that statment... even when only a 'pass', an

Re: Getting milliseconds in Python

2005-02-16 Thread mjs7231
"Return the time as a floating point number expressed in seconds since the epoch, in UTC. Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > What about bsddb? On most Unix systems it should be already > installed and on Windows it comes with the ActiveState distribution > of Python, so it should fullfill your requirements. As I understand it, bsddb doesn't expose the underlying Sleepyca

Re: ZODB performance (was Re: low-end persistence strategies?)

2005-02-16 Thread Diez B. Roggisch
> Chris (or anyone else), could you comment on ZODB's performance? I've > Googled around a bit and haven't been able to find anything concrete, so > I'm really curious to know how ZODB does with a few hundred thousand > objects. > Specifically, what level of complexity do your ZODB queries/search

Re: Getting milliseconds in Python

2005-02-16 Thread John Hunter
> "mjs7231" == mjs7231 <[EMAIL PROTECTED]> writes: mjs7231> This is no good, I am looking for milliseconds, not mjs7231> seconds.. as stated above. Well seconds/1000.0 = millseconds -- or are you worries about floating point error? 7 >>> from datetime import datetime 8 >>> dt = date

Re: low-end persistence strategies?

2005-02-16 Thread pyguy2
People sometimes run to complicated systems, when right before you there is a solution. In this case, it is with the filesystem itself. It turns out mkdir is an atomic event (at least on filesystems I've encountered). And, from that simple thing, you can build something reasonable as long as you

Re: more os.walk() issues... probably user error

2005-02-16 Thread rbt
rbt wrote: This function is intended to remove unwanted files and dirs from os.walk(). It will return correctly *IF* I leave the 'for fs in fs_objects' statement out (basically leave out the entire purpose of the function). It's odd, when the program goes into that statment... even when only a

Re: supress creation of .pyc files

2005-02-16 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to import a file without creating > a .pyc file? > > Of course you can delete the pyc in my script after > the import statement, but maybe there is a switch > that I have not found yet. > > The

Re: super not working in __del__ ?

2005-02-16 Thread Christopher J. Bottaro
Fredrik Lundh wrote: > "Warning: Due to the precarious circumstances under which __del__() > methods are invoked, exceptions that occur during their execution are > ignored, and a warning is printed to sys.stderr instead. Also, when > __del__() is invoked in response to a module be

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

2005-02-16 Thread john san
pure DOS, old pc, used for teaching . want show some "windows" under DOS (under Python). "Daniel Bowett" <[EMAIL PROTECTED]> news:[EMAIL PROTECTED] > john san wrote: > > How to install python under DOS and is there any Wxpython-like can be > > installed under dos? > > > > Thanks. > > > > >

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

2005-02-16 Thread john san
Just want to show "windows" under dos without MsWindows. Also find some difficulty to simply install WxPython under directory(DOS) and then run, which is very good thing if it is just like Java. I want a simple solution for Python to install to DOS and then can have "Windows" running.( to be used

Re: Getting milliseconds in Python

2005-02-16 Thread Diez B. Roggisch
mjs7231 wrote: > "Return the time as a floating point number expressed in seconds since > the epoch, in UTC. Note that even though the time is always returned as > a floating point number, not all systems provide time with a better > precision than 1 second. While this function normally returns >

Win32api shellexecute Bshow

2005-02-16 Thread Josh
Hi All, I am trying to print a pdf file from python using the Win32api shellexecute method and am having a problem, or perhaps just a misunderstanding, with the bshow parameter. Am I correct to assume that if the bshow parm is set to 0, that the program will not show when launched? e.g.: win32api

Re: more os.walk() issues... probably user error

2005-02-16 Thread [EMAIL PROTECTED]
That's an easy one: fs_objects is not modified by your ode, so you get it back as created by os.walk -- http://mail.python.org/mailman/listinfo/python-list

Re: more os.walk() issues... probably user error

2005-02-16 Thread Dan Perl
"rbt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > rbt wrote: >> This function is intended to remove unwanted files and dirs from >> os.walk(). It will return correctly *IF* I leave the 'for fs in >> fs_objects' statement out (basically leave out the entire purpose of the >> f

Re: low-end persistence strategies?

2005-02-16 Thread Michele Simionato
The documentation hides this fact (I missed that) but actually python 2.3+ ships with the pybsddb module which has all the functionality you allude too. Check at the test directory for bsddb. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread peter
Hello, nice solution: but it puzzles me :) can anyone tell me why ---correct solution def fA(input): return input def newFA(input, f= fA): return f(input) fA = newFA is correct and: -infinite loop- def fA(input): return input def newF

Re: more os.walk() issues... probably user error

2005-02-16 Thread Dan Perl
"rbt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > def build_clean_list(self, path): > > file_skip_list = ['search_results.txt'] > dir_skip_list = ['dev', 'proc', 'Temporary Internet Files'] > > fs_objects = os.walk(path, topdown=True) > ## for fs

Re: more os.walk() issues... probably user error

2005-02-16 Thread Kent Johnson
rbt wrote: rbt wrote: This function is intended to remove unwanted files and dirs from os.walk(). It will return correctly *IF* I leave the 'for fs in fs_objects' statement out (basically leave out the entire purpose of the function). It's odd, when the program goes into that statment... even w

Re: Getting milliseconds in Python

2005-02-16 Thread jdonnell
"This is no good, I am looking for milliseconds, not seconds.. as stated above. " The docs are not very clear. I had the same issue when I was trying to do the same thing, but the time and datetime modules return milliseconds on my linux machines. -- http://mail.python.org/mailman/listinfo/pytho

Python to be used for Mod Language in Battlefield 1942 Sequel

2005-02-16 Thread kdahlhaus
I love the orignal so much, now to hear that mod's will be created in Python, well it brings tears of joy. Python Used as Modding Language for Battlefield 2 Programming First Person Shooters (Games) Posted by Zonk on Friday February 11, @11:27AM from the snakes-and-guns dept. Dutch Dopey writ

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Satchidanand Haridas
peter wrote: Hello, nice solution: but it puzzles me :) can anyone tell me why ---correct solution def fA(input): return input def newFA(input, f= fA): return f(input) fA = newFA is correct and: >>> def fA(input): ... print "inside fA" ... return input ... >>>

Re: check if object is number

2005-02-16 Thread Steven Bethard
Fredrik Lundh wrote: Steven Bethard wrote: Actually no, floats don't meet this behaviour or more specifically floats don't guarantee this behaviour. It depends of course on your implementation of f, but it is possible with floats to keep incrementing and never reach a maximum. My code won't hit thi

Re: Getting milliseconds in Python

2005-02-16 Thread Fredrik Lundh
"mjs7231" <[EMAIL PROTECTED]> wrote: > "Return the time as a floating point number expressed in seconds since > the epoch, in UTC. Note that even though the time is always returned as > a floating point number, not all systems provide time with a better > precision than 1 second. While this functi

Re: super not working in __del__ ?

2005-02-16 Thread Fredrik Lundh
Christopher J. Bottaro wrote: > 2 Questions... > 1) Why does this never happen in C++? Or does it, its just never happened > to me? C++ uses an entirely different allocation model. if you think in C++ when you write Python, you will write bad Python. > 2) I can understand random destruction

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Michael Spencer
peter wrote: Hello, nice solution: but it puzzles me :) can anyone tell me why ---correct solution def fA(input): return input def newFA(input, f= fA): return f(input) fA = newFA is correct and: -infinite loop- def fA(input): return input d

Re: super not working in __del__ ?

2005-02-16 Thread Jeff Shannon
Christopher J. Bottaro wrote: 2 Questions... 1) Why does this never happen in C++? Or does it, its just never happened to me? 2) I can understand random destruction of instantiated objects, but I find it weird that class definitions (sorry, bad terminology) are destroyed at the same time. So __

Re: Getting milliseconds in Python

2005-02-16 Thread Brian Beck
mjs7231 wrote: This is no good, I am looking for milliseconds, not seconds.. as stated above. That IS what you want. seconds * 100 = milliseconds -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading functions from a file during run-time

2005-02-16 Thread Wensheng
#--- file bar.py def negate(n): return -n def square(n): return n*n #--- end bar.py >>> foo="bar" >>> fs=__import__(foo) >>> import types >>> f=[a for a in dir(fs) if a[0:2]!='__' and type(getattr(fs,a))==types.FunctionType] >>> f ['negate', 'square'] >>> n=5 >>> exec("print fs."+

Re: [Errno 18] Invalid cross-device link using os.rename

2005-02-16 Thread JustScott
Thanks, Jeff. I appreciate the input. I just stuck with os.system('mv %s %s'). Seems to work fine. On Mon, 14 Feb 2005 18:31:18 -0600, Jeff Epler <[EMAIL PROTECTED]> wrote: > mv is a surprisingly complex program, while os.rename is a wrapper > around rename(2) which is probably documented on yo

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Fredrik Lundh
"peter" <[EMAIL PROTECTED]> wrote > > PYTHON-CODE # REMARKS > referenceA = SomeObject() # referenceA -> SomeObject() > # references to the memory space of >

RE: Getting milliseconds in Python

2005-02-16 Thread Batista, Facundo
Title: RE: Getting milliseconds in Python [Brian Beck] #- seconds * 100 = milliseconds Wht? It really is   seconds = 1000 * milliseconds .    Facundo Bitácora De Vuelo: http://www.taniquetil.com.ar/plog PyAr - Python Argentina: http://pyar.decode.com.ar/ . . . . . . . . .

RE: renaming 'references' to functions can give recursive problem s

2005-02-16 Thread Batista, Facundo
Title: RE: renaming 'references' to functions can give recursive problems [Fredrik Lundh] #- you're confused.  resetting your brain and reading the documentation #- again might help: #- #- http://docs.python.org/ref/objects.html #- http://docs.python.org/ref/naming.html This artic

  1   2   3   >