Is there anyway to check the number of I/O registered in poll?

2011-03-29 Thread crow
I'm using select.poll to do I/O polling. polling is placed in a independent thread from select import poll _poller = poll() def poll(timeout): l = _poller.poll(timeout) return l In my code, in some context, the timeout value will be high ( like 1 hour ), but there is no I/O in _p

Re: delete namespaces

2011-03-29 Thread Terry Reedy
On 3/29/2011 9:14 PM, monkeys paw wrote: How do i delete a module namespace once it has been imported? I use import banner Then i make a modification to banner.py. When i import it again, the new changes are not reflected. The best thing, if possible, is to restart the program. If you develo

Re: Python3 Tkinter difficulty

2011-03-29 Thread harrismh777
Terry Reedy wrote: [python] 3.2 (which you should definitely be starting with) should, I think, be looking for [dev-tk] 8.5, which I believe is years old now and required, I also believe, for the tkinter.ttk module. Thanks everyone for your patience, and certainly for your help. I pulled down

Re: multiprocessing Pool.imap broken?

2011-03-29 Thread Yang Zhang
On Tue, Mar 29, 2011 at 6:44 PM, Yang Zhang wrote: > I've tried both the multiprocessing included in the python2.6 Ubuntu > package (__version__ says 0.70a1) and the latest from PyPI (2.6.2.1). > In both cases I don't know how to use imap correctly - it causes the > entire interpreter to stop resp

multiprocessing Pool.imap broken?

2011-03-29 Thread Yang Zhang
I've tried both the multiprocessing included in the python2.6 Ubuntu package (__version__ says 0.70a1) and the latest from PyPI (2.6.2.1). In both cases I don't know how to use imap correctly - it causes the entire interpreter to stop responding to ctrl-C's. Any hints? Thanks in advance. $ pytho

Re: delete namespaces

2011-03-29 Thread Tim Chase
On 03/29/2011 08:14 PM, monkeys paw wrote: How do i delete a module namespace once it has been imported? I use import banner Then i make a modification to banner.py. When i import it again, the new changes are not reflected. Is there a global variable i can modify? Delete it from sys.modules

Re: delete namespaces

2011-03-29 Thread Raymond Hettinger
On Mar 29, 6:14 pm, monkeys paw wrote: > How do i delete a module namespace once it has been imported? . . . > Then i make a modification to banner.py. When i import it again, > the new changes are not reflected. Is there a global variable i can > modify? In Python2.x, you can use the reload() f

delete namespaces

2011-03-29 Thread monkeys paw
How do i delete a module namespace once it has been imported? I use import banner Then i make a modification to banner.py. When i import it again, the new changes are not reflected. Is there a global variable i can modify? -- http://mail.python.org/mailman/listinfo/python-list

Re: send function keys to a legacy DOS program

2011-03-29 Thread Justin Ezequiel
On Tue, Mar 29, 2011 at 9:59 PM, Alexander Gattin wrote: > I'm not sure regarding the ASCII part. I think it > might need to be set to 0x00 for all functional > keys instead of 0x3F/0x3C/0x41, but probably no > application actually cares. > > Another thing is that you may need to send key > releas

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Paul Rubin
Ian Kelly writes: > cmp_to_key(lambda x, y: -cmp(x, y)) cmp_to_key(lambda x, y: cmp(y, x)) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to create a virtual printer

2011-03-29 Thread eryksun ()
On Monday, March 28, 2011 7:12:23 AM UTC-4, kalo...@gmail.com wrote: > > Does anybody know how to create a virtual > printer with python (on both windows and linux)? Here's some code I just put together showing how to use Python to create a PostScript file printer on Windows, output raw text to

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Ian Kelly
On Tue, Mar 29, 2011 at 5:06 PM, MRAB wrote: > I think I've found a solution: > >    class NegStr: >        def __init__(self, value): >            self._value = value >        def __lt__(self, other): >            return self._value > other._value IOW: cmp_to_key(lambda x, y: -cmp(x, y)) This

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread MRAB
On 29/03/2011 21:32, Dan Stromberg wrote: On Tue, Mar 29, 2011 at 12:48 PM, Ian Kelly mailto:ian.g.ke...@gmail.com>> wrote: On Tue, Mar 29, 2011 at 1:08 PM, Chris Angelico mailto:ros...@gmail.com>> wrote: > On Wed, Mar 30, 2011 at 5:57 AM, MRAB mailto:pyt...@mrabarnett.plus.com>> wrote

Only 7 Years

2011-03-29 Thread Cousin Stanley
On May 8, 2004 I posted a note[1] here in comp.lang.python with a subject line of Lost : Plot_Demo looking for a small 2d plot program that I had seen, misplaced, and which I thought came along as a demo with a PYTHON installation This morning after rooting about in an old JYT

Re: Free Software University - Python Certificate - In reply to Noah Hall

2011-03-29 Thread Lloyd Hardy
Hi 'News123', The message which you seem to think was a reply to you, wasn't. It was sent 2 days ago in reply to another message, not yours. _03/27/2011_ 01:15 PM Well, that is - as far as I know - I'm not sure if you're 'Noah Hall' or not.. maybe you are? That's the problem with having an

Re: Free Software University - Python Certificate - In reply to Noah Hall

2011-03-29 Thread News123
Hi Loyd, It wasn't me sending you the private email. I'm just a little surprised about this: "if you don't post under your real name you must be a bad person" - attitude. On 03/27/2011 01:15 PM, Lloyd Hardy wrote: > Secondly, if you do use various names and email addresses and play > 'maybe thi

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Dan Stromberg
On Tue, Mar 29, 2011 at 12:48 PM, Ian Kelly wrote: > On Tue, Mar 29, 2011 at 1:08 PM, Chris Angelico wrote: > > On Wed, Mar 30, 2011 at 5:57 AM, MRAB > wrote: > >> You would have to do more than that. > >> > >> For example, "" < "A", but if you "negate" both strings you get "" < > >> "\xBE", no

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Chris Angelico
On Wed, Mar 30, 2011 at 6:48 AM, Ian Kelly wrote: > Not to mention that it still has bugs: > > "" < "\0" > "\xff" < "\xff\xff" That's because \0 isn't less than any character, nor is \xff greater than any. However, the latter is true if (for instance) your string is in UTF-8; it may be possible t

Re: Free Software University - Python Certificate - In reply to Noah Hall

2011-03-29 Thread News123
Hi Loyd, Having a decent front page might help to attract people: Go to http://www.freesoftwareuni.com/ and try to get any useful information except (free / GPL / not accredited / your email address) With out signing in / without registering you don't even see what FSU has to offer / plans

Re: Fun python 3.2 one-liner

2011-03-29 Thread Terry Reedy
On 3/29/2011 5:50 AM, Raymond Hettinger wrote: from collections import Counter from itertools import product print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum, product(range(6), repeat=8))).items( The line break makes that hard to read; the axis is not labeled (and labels he

Re: Non-deterministic output

2011-03-29 Thread John Nagle
On 3/28/2011 3:42 AM, Esben Nielsen wrote: Hi, We are making a prototype program in Python. I discovered the output was non-deterministic, i.e. I rerun the program on the same input files and get different output files. We do not use any random calls, nor threading. One of us thought it could b

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Ian Kelly
On Tue, Mar 29, 2011 at 1:08 PM, Chris Angelico wrote: > On Wed, Mar 30, 2011 at 5:57 AM, MRAB wrote: >> You would have to do more than that. >> >> For example, "" < "A", but if you "negate" both strings you get "" < >> "\xBE", not "" > "\xBE". > > Strings effectively have an implicit character a

Re: Python3 Tkinter difficulty

2011-03-29 Thread Terry Reedy
On 3/29/2011 1:52 PM, harrismh777 wrote: Thanks. You're right... I don't have tk-dev installed. duh. And I have choices to make... it looks like setup.py is looking for 8.4 headers; I 3.2 (which you should definitely be starting with) should, I think, be looking for 8.5, which I believe is ye

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Terry Reedy
For anyone interested, the tracker discussion on removing cmp is at http://bugs.python.org/issue1771 There may have been more on the old py3k list and pydev list. One point made there is that removing cmp= made list.sort consistent with all the other comparision functions, min/max/nsmallest/nla

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Chris Angelico
On Wed, Mar 30, 2011 at 5:57 AM, MRAB wrote: > You would have to do more than that. > > For example, "" < "A", but if you "negate" both strings you get "" < > "\xBE", not "" > "\xBE". Strings effectively have an implicit character at the end that's less than any other character. Easy fix: Append

Re: Fun python 3.2 one-liner

2011-03-29 Thread harrismh777
Raymond Hettinger wrote: almost-normally-yours, Raymond thanks ... interesting Seriously, these little one liners teach me more about the python language in less time than *all* of the books I'm trying to digest right now. The toughest part of learning python is learning about what's avai

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread MRAB
On 29/03/2011 18:01, Dan Stromberg wrote: On Tue, Mar 29, 2011 at 1:46 AM, Antoon Pardon mailto:antoon.par...@rece.vub.ac.be>> wrote: The double sort is useless if the actual sorting is done in a different module/function/method than the module/function/method where the order is imp

Re: Fun python 3.2 one-liner

2011-03-29 Thread geremy condra
On Tue, Mar 29, 2011 at 11:24 AM, Raymond Hettinger wrote: print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum, product(range(6), repeat=8))).items( > > > > > > > > > * > *** > * > > > ** > * > ***

Re: Fun python 3.2 one-liner

2011-03-29 Thread Raymond Hettinger
>>> print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum, >>> product(range(6), repeat=8))).items( * *** * ** * * **

Re: Python3 Tkinter difficulty

2011-03-29 Thread harrismh777
Peter Otten wrote: We don't eat children above the age of three;) geez... that's good news :) > work... but, I'm at a bit of a loss to know exactly what its looking > for... libs, or libs and devel headers? or other? Most likely the development headers. Try installing tk-dev.

Re: Python-related Animation Packages?

2011-03-29 Thread Corey Richardson
On 03/29/2011 01:17 PM, Benjamin J. Racine wrote: > Hello all, > > Does anyone know of software that might be of use in an attempt to animate an > object undergoing 6-DOF rigid body motions: surge, sway, heave, roll, pitch > and yaw? > > Thanks so much, > Ben Racine > Blender. -- Corey Rich

Python-related Animation Packages?

2011-03-29 Thread Benjamin J. Racine
Hello all, Does anyone know of software that might be of use in an attempt to animate an object undergoing 6-DOF rigid body motions: surge, sway, heave, roll, pitch and yaw? Thanks so much, Ben Racine -- http://mail.python.org/mailman/listinfo/python-list

Re: Directly Executable Files in Python

2011-03-29 Thread CM
On Mar 29, 12:16 am, harrismh777 wrote: > Chris Rebert wrote: > > Yes. py2exe is a tool which generates such Windows executables: > >http://www.py2exe.org/ > > Interesting... but it can't possibly be creating .exe files > (compiling)... I don't buy it... it has to be reproducing the byte code > in

Re: Directly Executable Files in Python

2011-03-29 Thread CM
> it has to be reproducing the byte code > interpreter in the code segment and the byte code in the data segment... > so that each .exe file created by said process is actually loading an > entire copy of at least the byte code interpreter with each program > "compiled" ... Yes, if you think of i

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Dan Stromberg
On Tue, Mar 29, 2011 at 1:46 AM, Antoon Pardon wrote: > The double sort is useless if the actual sorting is done in a different > module/function/method than the module/function/method where the order > is implemented. It is even possible you didn't write the module > where the sorting actually o

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Fri, 25 Mar 2011 10:21:35 +0100, Antoon Pardon wrote: On Thu, Mar 24, 2011 at 11:49:53PM +, Steven D'Aprano wrote: On Thu, 24 Mar 2011 17:47:05 +0100, Antoon Pardon wrote: However since that seems to be a problem for you I will be more detailed. T

Re: send function keys to a legacy DOS program

2011-03-29 Thread Mel
Alexander Gattin wrote: > Another thing is that you may need to send key > release after key press in order for the > application to trigger the F5/F2/F7 event. I'm not > sure what the scan codes for F5/F2/F7 releases > are, but think that they may be: > > F5: 0xBF > F2: 0xBC > F7: 0xC1 True. The

your web page details

2011-03-29 Thread radha krishnan
http://123maza.com/65/agent409/ -- http://mail.python.org/mailman/listinfo/python-list

Re: popular programs made in python?

2011-03-29 Thread Corey Richardson
On 03/29/2011 10:32 AM, Neil Alt wrote: > i mean made with python only, not just a small part of python. Civilisation 4 (the game) used Python for all of its scripting. As far as I know almost all the game logic was in Python, and you could access most parts of the game. Blender also has a rather

Re: popular programs made in python?

2011-03-29 Thread Neil Alt
yeah nice example :) impressive. On 3/29/11, Chris Angelico wrote: > On Wed, Mar 30, 2011 at 1:32 AM, Neil Alt wrote: >> i mean made with python only, not just a small part of python. >> -- >> http://mail.python.org/mailman/listinfo/python-list >> > > You're using one right now. Mailman is writt

Re: popular programs made in python?

2011-03-29 Thread Chris Angelico
On Wed, Mar 30, 2011 at 1:32 AM, Neil Alt wrote: > i mean made with python only, not just a small part of python. > -- > http://mail.python.org/mailman/listinfo/python-list > You're using one right now. Mailman is written in Python, and it manages countless mailing lists the world over. I have it

popular programs made in python?

2011-03-29 Thread Neil Alt
i mean made with python only, not just a small part of python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Directly Executable Files in Python

2011-03-29 Thread Grant Edwards
On 2011-03-29, harrismh777 wrote: > Chris Rebert wrote: >> Yes. py2exe is a tool which generates such Windows executables: >> http://www.py2exe.org/ > > Interesting... but it can't possibly be creating .exe files It is. > (compiling)... It isn't. > I don't buy it... Then don't. > it has to b

Re: send function keys to a legacy DOS program

2011-03-29 Thread Alexander Gattin
Hello, On Sun, Mar 20, 2011 at 06:59:46PM -0700, Justin Ezequiel wrote: > On Mar 20, 7:30 am, Alexander Gattin > wrote: > > You need to place 2 bytes into the circular buffer > > to simulate key press. Lower byte is ASCII code, > > higher byte is scan code (they are the same for > > functional ke

Re: Linux drives me crazy... Rights, listdir...

2011-03-29 Thread durumdara
Hi! Sorry. The path was wrong! "backup_redmine <> redmine_backup"... :-( Thanks: dd -- http://mail.python.org/mailman/listinfo/python-list

Re: Directly Executable Files in Python

2011-03-29 Thread Ethan Furman
harrismh777 wrote: Chris Rebert wrote: Yes. py2exe is a tool which generates such Windows executables: http://www.py2exe.org/ Interesting... but it can't possibly be creating .exe files (compiling)... Yes and no. The python program is not being compiled. The Python system, along with all

Re: Fun python 3.2 one-liner

2011-03-29 Thread Xavier Ho
http://www.ideone.com/infch ^ Result of the below code On 29 March 2011 19:50, Raymond Hettinger wrote: > from collections import Counter > from itertools import product > > print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum, > product(range(6), repeat=8))).items( > > > almost-n

Fun python 3.2 one-liner

2011-03-29 Thread Raymond Hettinger
from collections import Counter from itertools import product print('\n'.join('*'*(c//2000) for _,c in sorted(Counter(map(sum, product(range(6), repeat=8))).items( almost-normally-yours, Raymond -- http://mail.python.org/mailman/listinfo/python-list

Linux drives me crazy... Rights, listdir...

2011-03-29 Thread durumdara
Dear Everybody! We have a redmine server with linux. I wrote some pythonic tool that backup the redmine (files and database) and put to ftp server. This was working fine. But today I checked, and I saw this failed in the prior week. As I checked more, I saw that part. is out of space. I stored t

Great chance for Management work.

2011-03-29 Thread gaurav
Railroad employers, opportunities in only on the site for government, banking and data entry. http://rojgars.webs.com/Railwayjobs.htm http://rojgars1.webs.com/gov.htm Cash income in Management careers. Globalize Management careers. http://managementjobs.webs.com/mm.htm http://jobshunter.webs.com

Re: Python3 Tkinter difficulty

2011-03-29 Thread Peter Otten
harrismh777 wrote: > Greetings folks, > I am very new to this usenet forum, and I am brand new to Python3... Welcome. > so be gentle We don't eat children above the age of three ;) > The source tarball for Python3 compiled and installed (local install > for first experiments $HOME/loc

Re: New blog from python-dev

2011-03-29 Thread Ivan Vilata i Balaguer
Doug Hellmann (2011-03-24 14:58:30 +0100) wrote: > Python Insider (http://blog.python.org/) is a new blog from the Python > core development team. [...] There are a variety of ways to subscribe, > including email and Twitter. [...] Hi Doug, this is great news, thank you! I've tried to subscribe

hi joining me

2011-03-29 Thread kalpana N
ms.kalpana2...@rediffmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Antoon Pardon
On Mon, Mar 28, 2011 at 03:43:03PM +, Steven D'Aprano wrote: > On Mon, 28 Mar 2011 14:39:04 +0200, Antoon Pardon wrote: > > > I tried to sort lists of 1 elemens. Each element a tuple two items > > that was to be sorted first according to the first item in ascending > > order, then accordin

Re: Directly Executable Files in Python

2011-03-29 Thread Paul Rudin
Benjamin Kaplan writes: > If you can figure out a good way to compile a language like Python, > you'll be very rich. Yes, it is running the interpreter and then > running the bytecode on the interpreter. It's the same way Java and > .NET work. Not exactly AIUI. .NET bytecodes do actually get co

Re: Guido rethinking removal of cmp from sort method

2011-03-29 Thread Antoon Pardon
On Mon, Mar 28, 2011 at 11:35:09AM +, Steven D'Aprano wrote: > [...] > > Forcing people to use a key-function, will produce cases where python > > will ask for more memory and take longer to sort, than allowing to > > provide a cmp function. > > More memory yes; take longer to sort, almost ce

Re: Non-deterministic output

2011-03-29 Thread Esben Nielsen
On Mon, 2011-03-28 at 12:58 +0100, Tim Wintle wrote: > On Mon, 2011-03-28 at 12:42 +0200, Esben Nielsen wrote: > > We are making a prototype program in Python. I discovered the output was > > non-deterministic, i.e. I rerun the program on the same input files and > > get different output files. We

Python3 Tkinter difficulty

2011-03-29 Thread harrismh777
Greetings folks, I am very new to this usenet forum, and I am brand new to Python3... so be gentle The source tarball for Python3 compiled and installed (local install for first experiments $HOME/local/) and runs very well in my terminal. I am not able to run IDLE because the compile b