Re: sorting a list and counting interchanges

2005-04-06 Thread Tim Peters
[RickMuller] > I have to sort a list, but in addition to the sorting, I need to > compute a phase factor that is +1 if there is an even number of > interchanges in the sort, and -1 if there is an odd number of > interchanges. So you want the parity ("sign") of the associated permutation. > I coul

Re: logging as root using python script

2005-04-06 Thread Harlin Seritt
Hi Raghul, If possible, run your program as root. Harlin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect windows shutdown

2005-04-06 Thread Austin
I wrote a GUI program with wxPython. The error message is: Unhandled exception An unhandled exception occured. Press "Abort" to terminate the program, "Retry" to exit the program normally and "Ignore" to try to continue. Actually, besides the main program, there is another thread running backgr

Re: Lambda: the Ultimate Design Flaw

2005-04-06 Thread Greg Ewing
Scott David Daniels wrote: Aahz wrote: You just can't have your cake and eat it, too. I've always wondered about this turn of phrase. I seldom eat a cake at one sitting. You need to recursively subdivide the cake until you have a piece small enough to fit in your input buffer. Then the atomicity o

Re: boring the reader to death (wasRe: Lambda: the Ultimate Design Flaw

2005-04-06 Thread Greg Ewing
"Sunnan" == Sunnan <[EMAIL PROTECTED]> writes: Sunnan> It's just that I'm having a hard time matching that quote Sunnan> to what I though python was about. I thought boring code Sunnan> was considered a virtue in python. There's a difference between unsurprising and boring. The coffee

Re: sorting a list and counting interchanges

2005-04-06 Thread RickMuller
>> 3. Of what practical use (or even esoteric academic interest) is the >> parity of the number of interchanges? >I presume the goal is academic, determining whether a >permutation is a member of >the alternating group of even permutations (A4, A5, ...). For >some problems, >that is a useful inva

Python backend binding to PAM, NSS or pppd

2005-04-06 Thread Heiko Wundram
Hey all! Before I start hacking away, I'm looking for a Python backend binding for libpam or libnss, or a python binding for the pppd plugin mechanism. I'm trying to set up an SQL authentication scheme for virtual user accounts used for mail and PPTP-VPN-access, and I'd love to do the authentic

[Announce] Gnosis Utils 1.2.0

2005-04-06 Thread David Mertz, Ph.D.
David Mertz ([EMAIL PROTECTED]) Frank McIngvale ([EMAIL PROTECTED]) This release of the Gnosis Utilities contains several new modules, as well as fixes, enhancements, and speedups in existing subpackages. Try it out, have fun, send feedback! NEW SUBPACKAGES

logging as root using python script

2005-04-06 Thread Raghul
Hi Is it possible to login as a root in linux using python script? What I need is when I execute a script it should login as root and execute my command and logout from root to my existing account. IS is possible? Thanx in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python modules for image / map manipulation?

2005-04-06 Thread [EMAIL PROTECTED]
my image file is only about 5 MB, so, it's not too large. I've done some testing with PIL and it will meet my needs, I think. I can see how I could slice and dice my image, or only present the cropped section that I need. thanks, S -- http://mail.python.org/mailman/listinfo/python-list

Re: Web application toolkit recommendation?

2005-04-06 Thread [EMAIL PROTECTED]
I have looked briefly at Karrigell. does it support user logins? S -- http://mail.python.org/mailman/listinfo/python-list

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Ok the key was "r+b" as opposed to "a+b" but why is that? R is for read, correct? And b for binary. Adding the plus gives me some form of write capability? Read binary is "rb," but read-write binary is "r+b." The "+" means that you can write, too. -- Erik Max Francis

Re: how can I extract all urls in a string by using re.findall() ?

2005-04-06 Thread Sidharth Kuruvila
Reading the documentation on re might be helpfull here :-P findall returns a tuple of all the groups in each match. You might find finditer usefull. for m in re.finditer(url, html) : print m.group() or you could replace all your paranthesis with the non-grouping version. That is, all bracke

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread [EMAIL PROTECTED]
Ok the key was "r+b" as opposed to "a+b" but why is that? R is for read, correct? And b for binary. Adding the plus gives me some form of write capability? -- http://mail.python.org/mailman/listinfo/python-list

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread [EMAIL PROTECTED]
Erik Max Francis wrote: > [EMAIL PROTECTED] wrote: > > > I'd like to overwrite just one line of a binary file, based on a > > position set by seek(). Is there no way to do this? As far as I can > > tell I need to read the whole file, change the line, and write it all > > back out. Not exactly ea

Re: sorting a list and counting interchanges

2005-04-06 Thread Raymond Hettinger
[John Machin] > 2. Without a definition that refers only to to the input and output, > one would have to say that "interchange" implies "event" and so the > number of interchanges would depend on the sorting method. As the dataset contains no duplicates, the parity will be the same irrespective of

Re: sorting a list and counting interchanges

2005-04-06 Thread RickMuller
Boy, what a snotty answer to a question that had nothing to do with a homework assignment! -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a list and counting interchanges

2005-04-06 Thread RickMuller
The combinatorics application is very close, since we use A(N) to represent fermions in quantum mechanics. -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a list and counting interchanges

2005-04-06 Thread RickMuller
Thanks, this will indeed work. I guess I've gotten out of the habit of writing cmp functions since Tim Peter's introduction to the sorting chapter in the first edition of the Python Cookbook convinced me it was inefficient. But the lists should be short here and this should work. -- http://mail.p

Re: sorting a list and counting interchanges

2005-04-06 Thread RickMuller
Well, it's a homework problem in the sense that I happen to be working on it at my home, but, no, I'm not in school anymore. In Quantum Mechanics we use determinants to enforce the Pauli principle, which says that anytime two electrons are exchanged the wave function has to change sign. In most Qua

Re: sorting a list and counting interchanges

2005-04-06 Thread Dan Bishop
Paul Rubin wrote: > John Machin <[EMAIL PROTECTED]> writes: ... > > 3. Of what practical use (or even esoteric academic interest) is the > > parity of the number of interchanges? > > It is of considerable interest in combinatorics. The group of even > permutations on N elements is called the alter

Weekly Python Patch/Bug Summary

2005-04-06 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 308 open (+11) / 2819 closed ( +7) / 3127 total (+18) Bugs: 882 open (+11) / 4913 closed (+13) / 5795 total (+24) RFE : 176 open ( +1) / 151 closed ( +1) / 327 total ( +2) New / Reopened Patches __ improveme

how can I extract all urls in a string by using re.findall() ?

2005-04-06 Thread could ildg
I want to retrieve all urls in a string. When I use re.fiandall, I get a list of tuples. My code is like below: [code] url=unicode(r"((http|ftp)://)?[\d]+\.)+){3}[\d]+(/[\w./]+)?)|([a-z]\w*((\.\w+)+){2,})([/][\w.~]*)*)") m=re.findall(url,html) for i in m: print i [/code] html is a variable

Re: sorting a list and counting interchanges

2005-04-06 Thread Paul Rubin
"Jordan Rastrick" <[EMAIL PROTECTED]> writes: > def mycmp(x,y): >global phase >c = cmp(x,y) >if c > 0: # i.e. a swap will be performed in the sort >phase = -phase >return c That doesn't necessarily work. You don't know that c>0 will always result in a swap. You don't know

Re: sorting a list and counting interchanges

2005-04-06 Thread Paul Rubin
John Machin <[EMAIL PROTECTED]> writes: > 1. What is an "interchange"? Swapping two elements during the sort. > 2. Without a definition that refers only to to the input and output, > one would have to say that "interchange" implies "event" and so the > number of interchanges would depend on the s

RE: Compiling extensions

2005-04-06 Thread Delaney, Timothy C (Timothy)
ake wrote: > I would like to compile extensions usig distutils. is there a way to > set which compiler to use ? > > I am using windows and VC++ 7.1 comp. python setup.py --help python setup.py build --help However, if you're using an installed version of VC++ 7.1 you shouldn't need to set the c

Re: sorting a list and counting interchanges

2005-04-06 Thread John Machin
On 6 Apr 2005 17:59:04 -0700, "Jordan Rastrick" <[EMAIL PROTECTED]> wrote: >Unless I'm mistaken, this doesnt quite work, because it switches the >parity of phase every time a comparison is made, rather than every time >a swap is made. So: > ># >phase = 1 >def mycmp(x,y): > global phase > c =

Re: sorting a list and counting interchanges

2005-04-06 Thread John Machin
On 6 Apr 2005 15:30:41 -0700, "RickMuller" <[EMAIL PROTECTED]> wrote: >I have to sort a list, but in addition to the sorting, I need to >compute a phase factor that is +1 if there is an even number of >interchanges in the sort, and -1 if there is an odd number of >interchanges. > >I could write a

RE: the bugs that try men's souls

2005-04-06 Thread Delaney, Timothy C (Timothy)
Jordan Rastrick wrote: > I had a doozy myself the other night, writing a mergesort for python's > deque class (I can't believe it doesnt come with one!) Post it to the Cookbook ... ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a list and counting interchanges

2005-04-06 Thread Raymond Hettinger
[Jordan Rastrick] > Unless I'm mistaken, this doesnt quite work, because it switches the > parity of phase every time a comparison is made, rather than every time > a swap is made. So: > > # > phase = 1 > def mycmp(x,y): >global phase >c = cmp(x,y) >if c > 0: # i.e. a swap will be perf

Re: sorting a list and counting interchanges

2005-04-06 Thread Jordan Rastrick
Unless I'm mistaken, this doesnt quite work, because it switches the parity of phase every time a comparison is made, rather than every time a swap is made. So: # phase = 1 def mycmp(x,y): global phase c = cmp(x,y) if c > 0: # i.e. a swap will be performed in the sort phase = -pha

Re: sorting a list and counting interchanges

2005-04-06 Thread Raymond Hettinger
[RickMuller] > I have to sort a list, but in addition to the sorting, I need to > compute a phase factor that is +1 if there is an even number of > interchanges in the sort, and -1 if there is an odd number of > interchanges. It occurs to me that the previously posted comparison count won't do it.

Re: Harvestman install not working

2005-04-06 Thread python newbie
First of all, please disregard the extra posts, Anand, I need to really really get a new newsreader. It kept on giving me an error, making me think that each sendbutton click wasnt' working. My mistake, I use the Harvestman.Py in the main folder, of course. It works fine. Thanks again. "Ana

Re: sorting a list and counting interchanges

2005-04-06 Thread Raymond Hettinger
[RickMuller] > I have to sort a list, but in addition to the sorting, I need to > compute a phase factor that is +1 if there is an even number of > interchanges in the sort, and -1 if there is an odd number of > interchanges. This sounds like a homework problem but will offer a solution anyway: >

Re: Harvestman install not working

2005-04-06 Thread python newbie
Thanks Anand, (both for writing Harvest, and for the reply.) By the way, I did try that, so that the command is: c:\python23\python.exe install.py py2exe -O2 --packages=encodings And this time the dist folder was created, but there were only these files in there: library.zip python23.dll unicod

Re: Harvestman install not working

2005-04-06 Thread python newbie
Thanks Anand, (both for writing Harvest, and for the reply.) By the way, I did try that, so that the command is: c:\python23\python.exe install.py py2exe -O2 --packages=encodings And this time the dist folder was created, but there were only these files in there: library.zip python23.dll unicod

Re: Harvestman install not working

2005-04-06 Thread StvB
Thanks Anand, (both for writing Harvest, and for the reply.) By the way, I did try that, so that the command is: c:\python23\python.exe install.py py2exe -O2 --packages=encodings And this time the dist folder was created, but there were only these files in there: library.zip python23.dll unicod

Re: Harvestman install not working

2005-04-06 Thread python newbie
Thanks Anand, (both for writing Harvest, and for the reply.) By the way, I did try that, so that the command is: c:\python23\python.exe install.py py2exe -O2 --packages=encodings And this time the dist folder was created, but there were only these files in there: library.zip python23.dll unicod

Re: Harvestman install not working

2005-04-06 Thread python newbie
Thanks Anand, (both for Harvestman and for the reply.) By the way, I did try that, so that the command is: c:\python23\python.exe install.py py2exe -O2 --packages=encodings And this time the dist folder was created, but there were only these files in there: library.zip python23.dll unicodedata.

Sybase module 0.37 released

2005-04-06 Thread Dave Cole
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: The 0.37 release is identical to 0.37pre3 as no problems were reported with the prerelease. This release contains a nu

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Jeremy Bowers
On Wed, 06 Apr 2005 12:49:51 -0700, ritterhaus wrote: > Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This > is actually test code for a larger project... > > # flash the selected wx.TextControl > > for flasher in range(4): > self.textField.SetBackgroundColour(255, 0,

Re: number conversion

2005-04-06 Thread John Machin
On 6 Apr 2005 12:01:23 -0700, [EMAIL PROTECTED] wrote: >I'm writing a program to read in raw data from a WAV file, and write it >to an IT file. I got this to work in C by reading the data into an >array of unsigned chars called "RawDataAry", then converted it to >signed chars by doing the followi

Re: Best editor?

2005-04-06 Thread Joey C.
When I'm using Windows, I have found the Syn TextEditor (http://syn.sourceforge.net) to be quite useful. It has basic syntax highlighting, about enough for me and is quite compatible with FTP and such. It supports Python pretty well. Its user interface is quite easy yet pretty powerful. All in

sorting a list and counting interchanges

2005-04-06 Thread RickMuller
I have to sort a list, but in addition to the sorting, I need to compute a phase factor that is +1 if there is an even number of interchanges in the sort, and -1 if there is an odd number of interchanges. I could write a bubble sort, count the number of interchanges, and compute the factor, but I

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: I'd like to overwrite just one line of a binary file, based on a position set by seek(). Is there no way to do this? As far as I can tell I need to read the whole file, change the line, and write it all back out. Not exactly easy on the memory, but I see no other solution

Re: re module non-greedy matches broken

2005-04-06 Thread lothar
well done. i had not noticed the lookahead operators. "André Malo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > * lothar wrote: > -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with access to shared memory(W2K) / ORIGINALLY (win32) speedfan api control

2005-04-06 Thread Claudio Grondi
Thomas Heller, it seems, that your email address [EMAIL PROTECTED] doesn't work or at least don't accept attachments, so maybe you can provide me with another one? > ptr = cast(pBuf, POINTER(Buffer)) > print ptr # should print > struct = ptr[0] results in breakdown of Python (Windows e

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-06 Thread D H
gf gf wrote: Really! That's a pity... Instead of trying to recreate a repository the size of CPAN, a Python interface to Perl modules is really called for. CPAN modules are designed for Perl though. There's pyperl like they mentioned but it's like speaking two languages at once. It's not like th

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Actually, I've tried ALL of these things, and none of them work. I HAVE > run the simple for-print-sleep test code to try to determine if this > issue was specific to wx (that's good troubleshooting, folks - you > narrow down the problem) and even that didn't work, so I

Re: Decorator Base Class: Needs improvement.

2005-04-06 Thread Ron_Adam
>I find I am still left asking the question "why would anyone want to do >that?". You didn't say which part you were referring too. As far as wrapping the same exact wrapper more than once. You probably wouldn't do that. It's just easier to test the use of multiple wrappers that way. As far as

Re: I've broken PythonWin2.4 - Dialogs don't pop up!

2005-04-06 Thread Neil Hodgson
Michael Murdock: > I have broken PythonWin and I don't know how or why. It worked great > until recently. I have installed / removed several apps since it worked > last. I could have a virus unknown to my antivirus program, I guess. > I'm stumped. You have tried rebooting? PythonWin can be

Re: Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I'd like to overwrite just one line of a binary file, based on a > position set by seek(). Is there no way to do this? As far as I can > tell I need to read the whole file, change the line, and write it all > back out. Not exactly easy on the me

Re: number conversion

2005-04-06 Thread Peter Hansen
[EMAIL PROTECTED] wrote: fmt = str(chunklen) + 'B' fmtsize = struct.calcsize(fmt) rawdata = struct.unpack(fmt, s[:fmtsize]) rawdata = list(rawdata) Then I tried to convert it: charary = array.array('b') charary.fromlist(rawdata) Uh, don't you want to be consistent in your use of signed and unsigned

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
Actually, I've tried ALL of these things, and none of them work. I HAVE run the simple for-print-sleep test code to try to determine if this issue was specific to wx (that's good troubleshooting, folks - you narrow down the problem) and even that didn't work, so I thought I'd start with the simple

Overwrite just one line? Am I a n00b or is this impossible? Both? :D

2005-04-06 Thread [EMAIL PROTECTED]
I'd like to overwrite just one line of a binary file, based on a position set by seek(). Is there no way to do this? As far as I can tell I need to read the whole file, change the line, and write it all back out. Not exactly easy on the memory, but I see no other solution. so far: patch

Re: Erroneous line number error in Py2.4.1 [Windows 2000+SP3]

2005-04-06 Thread "Martin v. Löwis"
Timo wrote: Does anyone have a clue what is going on? No. Please make a bug report to sf.net/projects/python. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Best editor?

2005-04-06 Thread Tim Keating
I bought the Komodo personal edition, and at only $30, it is worth it for the regular expression toolkit alone. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best editor

2005-04-06 Thread James Stroud
On Tuesday 05 April 2005 11:22 am, ChinStrap wrote: > I keep hearing everyone say Emacs, but I can't understand it at all. Both emacs and vi suffer from the fact that they can not be used by ordinary humans. Thus, I recommend using either to impress your friends. James -- http://mail.python.org

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Diez B. Roggisch
> Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. > This is actually test code for a larger project... No Nope - it _does_ work. Did you actually try it? Because you use it in a wrong context does not mean that it doesn't work. Besides, giving a wrong example to prove a point

Re: Problem with access to shared memory(W2K) / ORIGINALLY (win32) speedfan api control

2005-04-06 Thread Thomas Heller
"Claudio Grondi" <[EMAIL PROTECTED]> writes: >> For the mistake you made see below, hope that helps. > It doesn't. > >> > pBuf_buf = cast(pBuf, Buffer) >> Here's the problem. pBuf is a pointer to a Buffer structure, not the >> buffer structure itself. >> Something like >> pBuf_buf = Buffe

Re: Best editor?

2005-04-06 Thread François Pinard
[John J. Lee] > François Pinard <[EMAIL PROTECTED]> writes: > [...] > > Overall, Vim is also cleaner than Emacs, and this pleases me. > [...] > Is this still true when comparing XEmacs vs. vim? (rather than > GNU Emacs vs. vim) I've always used GNU Emacs, but I have got the > impression that XEmac

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Steve Holden
[EMAIL PROTECTED] wrote: Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This is actually test code for a larger project... # flash the selected wx.TextControl for flasher in range(4): self.textField.SetBackgroundColour(255, 0, 0) time.sleep(0.8) self.textField.SetB

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Mike Rovner
[EMAIL PROTECTED] wrote: Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This is actually test code for a larger project... # flash the selected wx.TextControl for flasher in range(4): self.textField.SetBackgroundColour(255, 0, 0) self.textField.Update() time.slee

Re: Best editor?

2005-04-06 Thread Ville Vainio
> "jjl" == John J Lee <[EMAIL PROTECTED]> writes: >> Other editors also do stuff Emacs won't do. Code completion is a >> killer feature and emacs sucks at it (yes, w/ Cedet too). jjl> I thought that too, but then I bound dabbrev-expand to F4, jjl> and it seems even better than

Re: Best editor?

2005-04-06 Thread Ville Vainio
> "caneff" == ChinStrap <[EMAIL PROTECTED]> writes: caneff> Anyone want to send me a configuration setup with Python caneff> in mind, and decent colors? http://www.emacswiki.org/cgi-bin/wiki/ColorTheme -- Ville Vainio http://tinyurl.com/2prnb -- http://mail.python.org/mailman/li

Re: Decorator Base Class: Needs improvement.

2005-04-06 Thread Scott David Daniels
Guess I am listening to language funny today. Steve Holden wrote: By the way, we pass *parameters* to functions, *perimeters* surround things. But we do pass parameters *around*, which may be the source of the confusion. :-) -Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/

(no subject)

2005-04-06 Thread python-list-bounces+archive=mail-archive . com
#! rnews 2135 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: Best editor? X-Nntp-Posting-Host: c

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
Nope. Does't work. Running Python 2.3.4 on Debian, Linux kernel 2.6. This is actually test code for a larger project... # flash the selected wx.TextControl for flasher in range(4): self.textField.SetBackgroundColour(255, 0, 0) time.sleep(0.8) self.textField.SetBackgroundColour(255, 25

Re: Mail Delivery (failure suggest@mathworks.com)

2005-04-06 Thread MATLAB/Simulink Suggestions
Hello, Thank you for sending us your comments. Any new suggestions or product enhancement requests that are sent to this address are immediately entered into our database and forwarded to the appropriate group in our Development staff. Every suggestion and enhancement request is reviewed and cons

Re: Problem with access to shared memory(W2K) / ORIGINALLY (win32) speedfan api control

2005-04-06 Thread Claudio Grondi
> For the mistake you made see below, hope that helps. It doesn't. > > pBuf_buf = cast(pBuf, Buffer) > Here's the problem. pBuf is a pointer to a Buffer structure, not the > buffer structure itself. > Something like > pBuf_buf = Buffer.from_address(pBuf) > may work. If I currently underst

I've broken PythonWin2.4 - Dialogs don't pop up!

2005-04-06 Thread Michael
I have broken PythonWin and I don't know how or why. It worked great until recently. I have installed / removed several apps since it worked last. I could have a virus unknown to my antivirus program, I guess. I'm stumped. -- The Symptoms - Here's what happens. I fire

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
This is running in the interactive 'PyShell', but in truth those print statements are part of a gui app that flashes a control in wx.widgets by toggling it's background color. The same behavior either way. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Just a simple bit of code to toggle between two state at intervals... > > import time > for i in range(4): > print 'On' > time.sleep(1) > print 'Off' > time.sleep(1) > > ... SHOULD toggle On and Off four times with one-second pauses. When I > run this,

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread Mike Rovner
[EMAIL PROTECTED] wrote: ... SHOULD toggle On and Off four times with one-second pauses. When I run this, the loop pauses the full eight seconds then prints the Ons and Offs all at once. What's up with that? Run your script as: python -u script.py for unbuffered output. -- http://mail.python.org/ma

Re: Python sleep doesn't work right in a loop?

2005-04-06 Thread [EMAIL PROTECTED]
For me it works fine. It seems that for you stdout is not flushed correctly in your terminal. What kind of terminal are you writing to? -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-06 Thread Steve Holden
gf gf wrote: Really! That's a pity... Instead of trying to recreate a repository the size of CPAN, a Python interface to Perl modules is really called for. Something like pyperl, for example? Instead of fretting over decorator syntax and lispiness, might I suggest that development efforts be direc

Python sleep doesn't work right in a loop?

2005-04-06 Thread ritterhaus
Just a simple bit of code to toggle between two state at intervals... import time for i in range(4): print 'On' time.sleep(1) print 'Off' time.sleep(1) ... SHOULD toggle On and Off four times with one-second pauses. When I run this, the loop pauses the full eight seconds then prin

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-06 Thread Jeff Reavis
An interface to Perl already exists: http://www.python.org/moin/PyPerl -jjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator Base Class: Needs improvement.

2005-04-06 Thread Steve Holden
Ron_Adam wrote: On Wed, 06 Apr 2005 08:10:22 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: I don't understand your seeming fixation with wrappers and wrapping. Fixated implies, I'm stuck on a single thing, but I'm not. I am learning as I go, and exploring some possibilities as well. :-) That's

number conversion

2005-04-06 Thread nicksjacobson
I'm writing a program to read in raw data from a WAV file, and write it to an IT file. I got this to work in C by reading the data into an array of unsigned chars called "RawDataAry", then converted it to signed chars by doing the following: signed char *CharAry = malloc(sizeof(signed char) * fra

Re: Best editor?

2005-04-06 Thread John J. Lee
Ville Vainio <[EMAIL PROTECTED]> writes: > > "Miki" == Miki Tebeka <[EMAIL PROTECTED]> writes: > > Miki> Emacs (or VIm in my case) takes time to learn. However when > Miki> you start to understand it and know you way around it'll do > Miki> things no other editor will do for you.

Re: Installing Python 2.4 on Linux

2005-04-06 Thread David Fraser
Edward Diener wrote: I can install Python 2.4 on the Fedora 3 Linux system, but after I do a number of Linux utilities and commands, like yum, stop working because they were dependent on the Python 2.3 installation. What happens is that Python 2.4 replaces the /usr/bin/python module with the Pyt

Re: Best editor?

2005-04-06 Thread John J. Lee
"ChinStrap" <[EMAIL PROTECTED]> writes: > When not using the interactive prompt, what are you using? I keep > hearing everyone say Emacs, but I can't understand it at all. I keep > trying to learn and understand why so many seem to like it because I > can't understand customization even without go

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-06 Thread gf gf
Really! That's a pity... Instead of trying to recreate a repository the size of CPAN, a Python interface to Perl modules is really called for. Instead of fretting over decorator syntax and lispiness, might I suggest that development efforts be directed to this? Developers, are you listening? Gu

Re: Best editor?

2005-04-06 Thread John J. Lee
François Pinard <[EMAIL PROTECTED]> writes: [...] > Overall, Vim is also cleaner than Emacs, and this pleases me. [...] Is this still true when comparing XEmacs vs. vim? (rather than GNU Emacs vs. vim) I've always used GNU Emacs, but I have got the impression that XEmacs is (was?) cleaner in some

Re: Decorator Base Class: Needs improvement.

2005-04-06 Thread Ron_Adam
On Wed, 06 Apr 2005 08:10:22 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >I don't understand your seeming fixation with wrappers and wrapping. Fixated implies, I'm stuck on a single thing, but I'm not. I am learning as I go, and exploring some possibilities as well. :-) > That's not >the only

Re: Lambda: the Ultimate Design Flaw

2005-04-06 Thread John J. Lee
Simon Brunning <[EMAIL PROTECTED]> writes: > On Apr 6, 2005 4:42 PM, Scott David Daniels <[EMAIL PROTECTED]> wrote: > > I've always wondered about this turn of phrase. I seldom > > eat a cake at one sitting. > > Clearly you're just not trying. ;-) :-))) John -- http://mail.python.org/mailma

Compiling extensions

2005-04-06 Thread ake
I would like to compile extensions usig distutils. is there a way to set which compiler to use ? I am using windows and VC++ 7.1 comp. Åke -- http://mail.python.org/mailman/listinfo/python-list

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-06 Thread Steven Bethard
Michael Spencer wrote: BTW, as I mentioned in a previous comment, I believe this would be more plainly written as type(self).__new__(), to emphasize that you are constructing the object without initializing it. (There is a explanation of __new__'s behaviour at http://www.python.org/2.2/descrin

Re: Problem with access to shared memory(W2K) / ORIGINALLY (win32) speedfan api control

2005-04-06 Thread Thomas Heller
"Claudio Grondi" <[EMAIL PROTECTED]> writes: > Background information: > - > in order to monitor mainboard sensory data > as fan speeds, temperatures, applications > like SpeedFan http://www.almico.com/speedfan.php > or MBM http://mbm.livewiredev.com/ > can be used.

Re: Harvestman install not working

2005-04-06 Thread Anand
Hi Latest version of py2exe does not support the option --force-imports anymore I think. You can edit the .bat file to remove that option. It should work. -Anand -- http://mail.python.org/mailman/listinfo/python-list

Re: how to parse system functions output

2005-04-06 Thread [EMAIL PROTECTED]
Or if you run 2.4 you can use subprocess -- http://mail.python.org/mailman/listinfo/python-list

Re: A ClientForm Question

2005-04-06 Thread John J. Lee
"narke" <[EMAIL PROTECTED]> writes: > John J. Lee wrote, > > > See second bullet point under "Why does .click()ing on a button not > work for me?". > > Thanks for you advice. However, after read through the FAQs, I have not > managed to find a solution for my problem. I belive my button is > co

Re: Semi-newbie, rolling my own __deepcopy__

2005-04-06 Thread Michael Spencer
[EMAIL PROTECTED] wrote: ... I see Steve Bethard has answered most of the points in your last eMail On line 11 we create a dictionary item in memo, [id(self):type(self)]...So now I'm confused as to the purpose of memo. Why should it contain the ID of the *original* object? No, you create memo[id(s

Re: Python Cookbook, 2'nd. Edition is published

2005-04-06 Thread Matteo Dell'Amico
Larry Bates wrote: I received my copy on Friday (because I was a contributor). I wanted to thank Alex, Anna, and David for taking the time to put this together. I think it is a GREAT resource, especially for beginners. This should be required reading for anyone that is serous about learning Pytho

Re: formatting file

2005-04-06 Thread Peter Otten
SPJ wrote: > test11.1-1   installed > test11.1-1   update > test22.1-1   installed > test22.1-2   update > > I want the file to be formatted in the following way: > > test11.1-1   1.1-2 > test22.1-1   2.1-2 The following program expects a sorted input file: import itert

Re: (win32) speedfan api control

2005-04-06 Thread Claudio Grondi
I have got the specs for SpeedFan from the SpeedFan author :-) , but ... inbetween I found, that full specs of the shared memory access to fan speeds, board, CPU temperature data are also exposed by the MBM application http://mbm.livewiredev.com and already published online (including C, VB, Delp

richcmpfunc semantics

2005-04-06 Thread harold fellermann
Hi all, I want to implement rich comparision in an extension class. Problem is I cannot find good documentation of the richcmpfunc semantics. Given the signature richcmpfunc compare(PyObject *,PyObject, int); I supposed the two objects passed are the ones to be compared. What is the meaning of t

Problem with access to shared memory(W2K) / ORIGINALLY (win32) speedfan api control

2005-04-06 Thread Claudio Grondi
Background information: - in order to monitor mainboard sensory data as fan speeds, temperatures, applications like SpeedFan http://www.almico.com/speedfan.php or MBM http://mbm.livewiredev.com/ can be used. Both of the mentioned apps expose data got from the hardwar

Re: shebang in cross platform scripts

2005-04-06 Thread Bill Mill
On Apr 6, 2005 11:06 AM, Ivan Van Laningham <[EMAIL PROTECTED]> wrote: > Hi All-- > > Simon Brunning wrote: > > > > On Apr 6, 2005 2:37 PM, rbt <[EMAIL PROTECTED]> wrote: > > > > > Does the line below have any negative impact on Windows machines? I > > > develop and test mostly on Unix, but my scr

  1   2   >