Re: random seed

2005-08-16 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Thanks. I guess I will use the system time and pass it as seed > explicitly. My goal is to replicate the random numbers that I generate > to ensure repeatabilty in the regression test suite that I am trying > to write. In that case you should just pick a single seed yo

Re: Help!

2005-08-16 Thread dimitri pater
Hi, the MS-DOS Prompt is actually the Python shell: >>> Now type: >>> print "Hello Ert" and it returns: Hello Ert Your first Python program! Do yourself a favour and google for "python tutorials" good luck, dimitri On 8/17/05, Ert Ert <[EMAIL PROTECTED]> wrote: When ever i try  to open python it op

Re: stopping a python windows service

2005-08-16 Thread Benjamin Niemann
DK wrote: > i was able to successfully create a windows service using py2exe. it > polls a website periodically and logs it to a file. this is done using > a function that does an infinite loop with periodic "sleeps". > > my question is... > > what's the best way to stop this service gracefully?

Re: stopping a python windows service

2005-08-16 Thread Grig Gheorghiu
Here are 2 recipes from the online Python Cookbook. I've used this one very successfully: . This one seems simpler: Grig -- http://mail.python.org/mailman/listinfo/pyt

Re: __del__ pattern?

2005-08-16 Thread bryanjugglercryptographer
Chris Curvey wrote: > I need to ensure that there is only one instance of my python class on > my machine at a given time. (Not within an interpreter -- that would > just be a singleton -- but on the machine.) These instances are > created and destroyed, but there can be only one at a time. > > S

Re: GUI tookit for science and education

2005-08-16 Thread Mateusz Łoskot
Markus Rosenstihl napisał(a): >>> It doesn't have much math built in. For functions you have to >>> plot points. >> >> >> If you want to plot stuff, the gnuplot-py module is very easy >> to use. http://sourceforge.net/projects/gnuplot-py/ >> [...] > > matplotlib is also ver good possibility >

Re: stopping a python windows service

2005-08-16 Thread Do Re Mi chel La Si Do
Hi ! Use SC.exe (windows-XP) (with popen ?) For help :sc /? You can, also, try : qprocess /? tasklist /? taskkill /? etc. @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-16 Thread Terry Reedy
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > IOW, "...open the box and find the i'th item /in/ the box..." is not > really > finding the i'th item _itself_ "/in/" the box. It is finding one end of a > string > tied to some point /in/ the box, but the actual item

Re: __del__ pattern?

2005-08-16 Thread BranoZ
[EMAIL PROTECTED] wrote: > For a reasonably portable solution, leave the lock file open. > On most systems, you cannot delete an open file,.. On most UNIXes, you can delete an open file. Even flock-ed. This is BTW also an hack around flock. 1. Process A opens file /var/tmp/test1, and flocks descri

Urgent: Embedding Python problems - advice sought

2005-08-16 Thread adsheehan
Hi, I am embedding Python into a multi-threaded C++ application running on Solaris and need urgent clarification on the embedding architecture and its correct usage (as I am experience weird behaviors). Can anyone clarify: - if Python correctly supports multiple sub-interpreters (Py_NewInterp

List copying idiom was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Tom Anderson
On Tue, 16 Aug 2005, Ron Adam wrote: > Simon Brunning wrote: > >> On 8/14/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote: >> >>> I can imagine that *a lot* of libs/scripts use the copy library, >> >> I think that copy is very rarely used. I don't think I've ever imported it. > > I use copy.deepco

Re: Windows message pump problems

2005-08-16 Thread Neil Hodgson
Cantankerous Old Git: > Problem 1: > If I have another thread call DestroyWindow after a delay, it gets an > error "permission denied". I really can't see why. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/wind

FW: List copying idiom was Re: [Python-Dev] implementation of copystandard lib

2005-08-16 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l Forwarded to python-list, where it belongs. The idiom is actually: a = [1, 2, 3] b = a[:] Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: List copying idiom was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread John Machin
Tom Anderson wrote: > > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l > > ? Why not m = L[:] instead of m = []; m[:] = L ??? > > That's what i've been doing. The other day, i realised that i could just > do: > > l = someList() > m = list

Re: __del__ pattern?

2005-08-16 Thread Michael Hudson
[EMAIL PROTECTED] writes: > Chris Curvey wrote: >> I need to ensure that there is only one instance of my python class on >> my machine at a given time. (Not within an interpreter -- that would >> just be a singleton -- but on the machine.) These instances are >> created and destroyed, but there

Re: keeping a ref to a non-member function in a class

2005-08-16 Thread Gregory Bond
Peter Otten wrote: > > You are on the right track with staticmethod, but you have to apply it to > fn: > > ... fn = staticmethod(foo) Thanks Peter, that's a big help. I can solve my problem now, but I'm chasing this further in the name of education, because it seems there is some deep ma

Re: How can I exclude a word by using re?

2005-08-16 Thread could ildg
Thanks for all of you~ I made it. Pyparsing is really nice. On 16 Aug 2005 11:33:48 -0700, Paul McGuire <[EMAIL PROTECTED]> wrote: > I just reviewed what the re "\s" signifies: whitespace. This is easy, > pyparsing ignores all intervening whitespace by default. So mp3Entry > simplfies to: > > m

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-16 Thread Bengt Richter
On Tue, 16 Aug 2005 19:24:04 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >"Bengt Richter" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> IOW, "...open the box and find the i'th item /in/ the box..." is not >> really >> finding the i'th item _itself_ "/in/" the box. It is f

Re: Library vs Framework

2005-08-16 Thread Mike Meyer
Peter Decker <[EMAIL PROTECTED]> writes: > I've written several apps that need to update a database, and each one > had to do the same things: connect, grab data, create controls to > display/edit that data, validate any changes and then stuff the edited > data back into the database. I started pl

Re: Library vs Framework

2005-08-16 Thread Peter Decker
On 8/16/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Well, they may have created a library class that does the job for > them. Figuring out which is which seemed to be the point of this > thread. I guess my summary of the thread was that a library is built to do one thing, while a framework is bui

Re: open links in a html page

2005-08-16 Thread Mike Meyer
"Ajar" <[EMAIL PROTECTED]> writes: > Hi, > > Using urllib2,ClinetForm and ClinetCookie modules I have logged into my > ISPs web site and managed to fetch the first page. Now, on this page > there is this link: > > Service > Records > > I need to click this link from python code. How do I do it? ch

Sep 9 is the last day for reduced rates for OOPSLA 2005

2005-08-16 Thread Gail E. Harris
OOPSLA 2005 is being held in San Diego, Oct 16 to 20. Invited speakers include: Robert Hass, Martin Fowler, Gerald Jay Sussman Grady Booch, Jimmy Wales, Mary Beth Rosson, David P. Reed The conference features 29 research papers, 58 tutorials by leaders in their fields, 23 Workshops,

Re: get the return code when piping something to a python script?

2005-08-16 Thread Jeff Schwab
mhenry1384 wrote: > On WinXP, I am doing this > > nant.exe | python MyFilter.py > > This command always returns 0 (success) because MyFilter.py always > succeeds. ... > How do I set the return code from MyFilter.py based on the return of > nant.exe? Is this possible? I have googled around for

Re: How to obtain GMT offset?

2005-08-16 Thread Erik Max Francis
Bengt Richter wrote: > > time.timezone gives you the timezone offset in minutes. > > ITYM seconds? I sure did. But at least minutes is a more entertaining answer. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis

Re: base64.encode and decode not correct

2005-08-16 Thread Damir Hakimov
Damir b wrote: >Hi *! > >I found a strange bug in base64.encode and decode, when I try to encode >- decode a file 1728512 bytes lenth. >Is somebody meet with this? I don't attach the file because it big, but >can send to private. > >Which solution for transfer file (binary data) via string-only

Making programs work together.

2005-08-16 Thread ChuckDubya
I'm looking to make what's basically a macro for a computer game. But I want this "macro" to take information from the game itself, so it's not really a macro. How do I access the data from my game to use in a program? -- http://mail.python.org/mailman/listinfo/python-list

Re: Making programs work together.

2005-08-16 Thread Bengt Richter
On 16 Aug 2005 22:30:51 -0700, [EMAIL PROTECTED] wrote: >I'm looking to make what's basically a macro for a computer game. But >I want this "macro" to take information from the game itself, so it's >not really a macro. > >How do I access the data from my game to use in a program? > How do I acces

Re: keeping a ref to a non-member function in a class

2005-08-16 Thread Peter Otten
Gregory Bond wrote: > Thanks Peter, that's a big help. You're welcome. > I can solve my problem now, but I'm chasing this further in the name of > education, because it seems there is some deep magic happening here that > I don't understand. Python resorts to deep magic only when it's inevitabl

Re: Making programs work together.

2005-08-16 Thread ChuckDubya
Example: I'm driving a car in a game and I hit an oil slick so instead of me having to lift off the throttle button on the keyboard, I want to make a program to disengage the throttle as long as I'm on that oil slick. Does that clear anything up? -- http://mail.python.org/mailman/listinfo/python

Embedding Python in C, undefined symbol: PyExc_FloatingPointError

2005-08-16 Thread Simon Newton
Hi, I've just starting out embedding Python in C and get the following error when I try and import a module that in turn imports the math module. ImportError: /usr/lib/python2.4/lib-dynload/math.so: undefined symbol: PyExc_FloatingPointError The module is as follows: # begin script.py import ma

Re: Making programs work together.

2005-08-16 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Example: I'm driving a car in a game and I hit an oil slick so instead > of me having to lift off the throttle button on the keyboard, I want to > make a program to disengage the throttle as long as I'm on that oil > slick. Does that clear anything up? Yes. Here's how

<    1   2