Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread W. eWatson
On 11/18/2011 9:03 PM, W. eWatson wrote: ... 3.3.2? I do not see that in his single message I found. I see a 3.2.2 release on . Google shows me nothing for 3.3.2. I see: * Windows x86 MSI Installer (3.2.2) (sig) and Visual Studio debug informatio

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread W. eWatson
... 3.3.2? I do not see that in his single message I found. I see a 3.2.2 release on . Google shows me nothing for 3.3.2. I see: * Windows x86 MSI Installer (3.2.2) (sig) and Visual Studio debug information files (sig) * Windows X86-64 MSI Install

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread Steven D'Aprano
On Fri, 18 Nov 2011 16:31:03 -0800, W. eWatson wrote: > Somehow 3.3.2 doesn't look like 2.7.2. Oops, so you're right. Sorry for the noise. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Data Plotting Library Dislin 10.2

2011-11-18 Thread sturlamolden
On 18 Nov, 22:16, Tony the Tiger wrote: > Ya, but apparently no source unless you dig deep into your pockets. > Really, why would we need this when we already have gnuplot? > Just wondering... Dislin is a very nice plotting library for scientific data, particularly for scientists and engineers u

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
On Nov 18, 10:55 am, MRAB wrote: > On 18/11/2011 15:48, Junfeng Hu wrote: > > > > > > > Thanks > > Yes, I had tried this before, so you could find that I comment the line > > sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) > > Here is the results. > > D:\Python test>mythread2.py > > Tra

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread MRAB
On 19/11/2011 00:50, W. eWatson wrote: On 11/18/2011 4:31 PM, W. eWatson wrote: On 11/18/2011 3:44 PM, Steven D'Aprano wrote: On Fri, 18 Nov 2011 10:06:47 -0800, W. eWatson wrote: Undoubtedly some of you have seen my post Both Python 2.5.2 and 2.7.2 flop the same way under Win 7. One thing I

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread W. eWatson
On 11/18/2011 4:31 PM, W. eWatson wrote: On 11/18/2011 3:44 PM, Steven D'Aprano wrote: On Fri, 18 Nov 2011 10:06:47 -0800, W. eWatson wrote: Undoubtedly some of you have seen my post Both Python 2.5.2 and 2.7.2 flop the same way under Win 7. One thing I think no one has offered is whether the

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread W. eWatson
On 11/18/2011 3:44 PM, Steven D'Aprano wrote: On Fri, 18 Nov 2011 10:06:47 -0800, W. eWatson wrote: Undoubtedly some of you have seen my post Both Python 2.5.2 and 2.7.2 flop the same way under Win 7. One thing I think no one has offered is whether their installation of 2.7.2 has the same IDLE

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread Steven D'Aprano
On Fri, 18 Nov 2011 10:06:47 -0800, W. eWatson wrote: > Undoubtedly some of you have seen my post Both Python 2.5.2 and 2.7.2 > flop the same way under Win 7. > > One thing I think no one has offered is whether their installation of > 2.7.2 has the same IDLE oddity that I've described. That is,

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread Stephen Hansen
On 11/17/11 8:34 PM, W. eWatson wrote: > On 11/17/2011 7:04 PM, alex23 wrote: >> On Nov 18, 2:55 am, "W. eWatson" wrote: >>> Comments? >> >> Are you using the vanilla installer or ActiveState's ActivePython? I >> find the latter integrates better with Windows. >> >> Also, out of curiousity, 32 or

Resources consumed by parent

2011-11-18 Thread Mihai Badoiu
How do I get the resources consumed by the parent process? getrusage() in the resource module seems to work only for self or the children processes. thanks, --mihai -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread W. eWatson
On 11/18/2011 10:06 AM, W. eWatson wrote: Undoubtedly some of you have seen my post Both Python 2.5.2 and 2.7.2 flop the same way under Win 7. One thing I think no one has offered is whether their installation of 2.7.2 has the same IDLE oddity that I've described. That is, if you right-click on

Python 2.7.2 on Win7 and IDLE (Try it)

2011-11-18 Thread W. eWatson
Undoubtedly some of you have seen my post Both Python 2.5.2 and 2.7.2 flop the same way under Win 7. One thing I think no one has offered is whether their installation of 2.7.2 has the same IDLE oddity that I've described. That is, if you right-click on a py file, do you see a choice for the

Re: Dynamically Generate Methods

2011-11-18 Thread Ian Kelly
On Fri, Nov 18, 2011 at 7:51 AM, GZ wrote: > Hi, > > I have a class Record and a list key_attrs that specifies the names of > all attributes that correspond to a primary key. > > I can write a function like this to get the primary key: > > def get_key(instance_of_record): > return tuple(instance

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/17/2011 9:25 PM, Benjamin Kaplan wrote: On Thu, Nov 17, 2011 at 11:21 PM, W. eWatson wrote: On 11/17/2011 7:59 PM, Dave Angel wrote: On 11/17/2011 03:31 PM, W. eWatson wrote: On 11/17/2011 9:39 AM, John Gordon wrote: Can you add IDLE manually to the associated applications list?

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/17/2011 11:35 PM, Terry Reedy wrote: On 11/17/2011 7:03 PM, W. eWatson wrote: I have not found any successful way to get to IDLE. Use the start menu to start IDLE once. Then pin it to your taskbar. If you do not have STart/ all programs / Python / IDLE, then your installation is bad. A

Re: Dynamically Generate Methods

2011-11-18 Thread Duncan Booth
GZ wrote: > For example, if key_attrs=['A','B'], I want the generated function to > be equivalent to the following: > > def get_key(instance_of_record): >return (instance_of_record['A'],instance_of_record['B'] ) > > I realize I can use eval or exec to do this. But is there any other > way t

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/18/2011 9:19 AM, rusi wrote: On Nov 18, 10:12 pm, MRAB wrote: On 18/11/2011 15:29, W. eWatson wrote: On 11/18/2011 5:11 AM, Neil Cerutti wrote: On 2011-11-18, W. eWatson wrote: On 11/17/2011 4:24 PM, Steven D'Aprano wrote: On Thu, 17 Nov 2011 16:03:14 -0800, W. eWatson wrote:

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/18/2011 9:12 AM, MRAB wrote: On 18/11/2011 15:29, W. eWatson wrote: On 11/18/2011 5:11 AM, Neil Cerutti wrote: On 2011-11-18, W. eWatson wrote: On 11/17/2011 4:24 PM, Steven D'Aprano wrote: On Thu, 17 Nov 2011 16:03:14 -0800, W. eWatson wrote: I have not found any successful way to ge

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread rusi
On Nov 18, 10:12 pm, MRAB wrote: > On 18/11/2011 15:29, W. eWatson wrote: > > > > > > > > > On 11/18/2011 5:11 AM, Neil Cerutti wrote: > >> On 2011-11-18, W. eWatson wrote: > >>> On 11/17/2011 4:24 PM, Steven D'Aprano wrote: > On Thu, 17 Nov 2011 16:03:14 -0800, W. eWatson wrote: > > > I

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread MRAB
On 18/11/2011 15:29, W. eWatson wrote: On 11/18/2011 5:11 AM, Neil Cerutti wrote: On 2011-11-18, W. eWatson wrote: On 11/17/2011 4:24 PM, Steven D'Aprano wrote: On Thu, 17 Nov 2011 16:03:14 -0800, W. eWatson wrote: I have not found any successful way to get to IDLE. It's on on the right-clic

Re: Dynamically Generate Methods

2011-11-18 Thread Jean-Michel Pichavant
GZ wrote: Hi, I have a class Record and a list key_attrs that specifies the names of all attributes that correspond to a primary key. I can write a function like this to get the primary key: def get_key(instance_of_record): return tuple(instance_of_record.__dict__[k] for k in key_attrs) Ho

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread MRAB
On 18/11/2011 15:48, Junfeng Hu wrote: Thanks Yes, I had tried this before, so you could find that I comment the line sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) Here is the results. D:\Python test>mythread2.py Traceback (most recent call last): File "", line 1, in File "C:\P

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Chris Angelico
On Sat, Nov 19, 2011 at 3:11 AM, Junfeng Hu wrote: > Hi Chris. > The socket only binded once. That's the problem I'm puzzleing, I think it may > a bug of multiprocessing in windows, or something I missed. I don't know how multiprocessing goes about initializing those subprocesses; I suspect that

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
Hi Chris. The socket only binded once. That's the problem I'm puzzleing, I think it may a bug of multiprocessing in windows, or something I missed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Chris Angelico
On Sat, Nov 19, 2011 at 2:51 AM, Junfeng Hu wrote: > And actually ,the socket hadn't been used in this script. Doesn't matter that you haven't used it; you're binding to the port, that's what causes the 10048. I think the main problem is that you're trying to share sockets across processes, but

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/17/2011 8:34 PM, Dennis Lee Bieber wrote: On Thu, 17 Nov 2011 08:55:36 -0800, "W. eWatson" declaimed the following in gmane.comp.python.general: Months ago 2.5.2 stopped functioning on my Win7 PC, so a few days ago I uninstalled and installed. Same problem. If one right-clicks on a py f

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/17/2011 8:34 PM, Dennis Lee Bieber wrote: On Thu, 17 Nov 2011 08:55:36 -0800, "W. eWatson" declaimed the following in gmane.comp.python.general: Months ago 2.5.2 stopped functioning on my Win7 PC, so a few days ago I uninstalled and installed. Same problem. If one right-clicks on a py f

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
And actually ,the socket hadn't been used in this script. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
Thanks Yes, I had tried this before, so you could find that I comment the line sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) Here is the results. D:\Python test>mythread2.py Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\multiprocessing\forking.py",

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread W. eWatson
On 11/18/2011 5:11 AM, Neil Cerutti wrote: On 2011-11-18, W. eWatson wrote: On 11/17/2011 4:24 PM, Steven D'Aprano wrote: On Thu, 17 Nov 2011 16:03:14 -0800, W. eWatson wrote: I have not found any successful way to get to IDLE. It's on on the right-click of a py menu, and, if I go the ...lib

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Chris Angelico
On Fri, Nov 18, 2011 at 9:23 PM, Junfeng Hu wrote: > Hi All, I'm trying to leverage my core i5 to send more UDP packets with > multiprocssing, but I found a interesting thing is that the socket.bind is > always reporting 10048 error even the process didn't do anything about the > socket. > sock

Re: Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
I did a test on linux, it works well, so the issue is related to os. -- http://mail.python.org/mailman/listinfo/python-list

Dynamically Generate Methods

2011-11-18 Thread GZ
Hi, I have a class Record and a list key_attrs that specifies the names of all attributes that correspond to a primary key. I can write a function like this to get the primary key: def get_key(instance_of_record): return tuple(instance_of_record.__dict__[k] for k in key_attrs) However, since

Re: Passing DLL handle as an argument (in Windows)

2011-11-18 Thread Ulrich Eckhardt
Am 18.11.2011 12:49, schrieb Pekka Kytölä: What I'd like to do is that after fetching those SDK function pointers I'd like to fire up .py/.pyc that snoops for possible plugins written in python and registers those plugins and callbacks and let them react to events. Obviously this python code need

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-18 Thread Neil Cerutti
On 2011-11-18, W. eWatson wrote: > On 11/17/2011 4:24 PM, Steven D'Aprano wrote: >> On Thu, 17 Nov 2011 16:03:14 -0800, W. eWatson wrote: >> >>> I have not found any successful way to get to IDLE. It's on on the >>> right-click of a py menu, and, if I go the ...lib/idle.pyw, it fails >>> with a "i

Re: What exactly is "pass"? What should it be?

2011-11-18 Thread MRAB
On 18/11/2011 04:34, Dennis Lee Bieber wrote: On Thu, 17 Nov 2011 18:18:11 -0800 (PST), John Ladasky declaimed the following in gmane.comp.python.general: I'm trying to write tidy, modular code which includes a long-running process. From time to time I MIGHT like to check in on the progress

Re: Passing DLL handle as an argument (in Windows)

2011-11-18 Thread Pekka Kytölä
Hmm. Let me describe what is going a bit more carefully: What I build is a dll file that has exported function that gets called when the host application/dll loads my dll. In this function the function pointers to the actual SDK functions are fetched. After this my dll's registers some plugins tha

[ANN] Data Plotting Library Dislin 10.2

2011-11-18 Thread Helmut Michels
Dear Python programmers, I am pleased to announce version 10.2 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 s

Re: How to insert my own module in front of site eggs?

2011-11-18 Thread Hans Mulder
On 18/11/11 03:58:46, alex23 wrote: On Nov 18, 11:36 am, Roy Smith wrote: What if the first import of a module is happening inside some code you don't have access to? No import will happen until you import something. That would be the case if you use the '-S' command line option. Otherwis

Re: Passing DLL handle as an argument (in Windows)

2011-11-18 Thread Pekka Kytölä
On Nov 18, 10:27 am, Ulrich Eckhardt wrote: > Am 18.11.2011 08:51, schrieb Pekka Kytölä: > > > Is it possible to pass my own dll's (already loaded) handle as an > > argument to load/attach to the very same instance of dll? Thing is > > that I've done plugin (dll) to a host app and the SDK's functi

Why sock.bind is always report 10048 error when in a script with multiprocessing

2011-11-18 Thread Junfeng Hu
Hi All, I'm trying to leverage my core i5 to send more UDP packets with multiprocssing, but I found a interesting thing is that the socket.bind is always reporting 10048 error even the process didn't do anything about the socket. Here is the script import threading,socket,random,pp,os import ti

Re: What exactly is "pass"? What should it be?

2011-11-18 Thread Thomas Rachel
Am 18.11.2011 05:34 schrieb Dennis Lee Bieber: >> def _pass(*args): >> pass >> >> def long_running_process(arg1, arg2, arg_etc, report = _pass): >> result1 = do_stuff() >> report(result1) > > So this is a call to a function that just returns a None, which is > dropped by the interpr

Re: Passing DLL handle as an argument (in Windows)

2011-11-18 Thread Ulrich Eckhardt
Am 18.11.2011 08:51, schrieb Pekka Kytölä: Is it possible to pass my own dll's (already loaded) handle as an argument to load/attach to the very same instance of dll? Thing is that I've done plugin (dll) to a host app and the SDK's function pointers are assigned once the dll is loaded in the host

useless python - term rewriter

2011-11-18 Thread Sean McIlroy
## term rewriter (python 3.1.1) def gettokens(string): spaced = string.replace('(',' ( ').replace(')',' ) ') return spaced.split() def getterm(tokens): if tokens[0] in '()': term = [] assert tokens[0] == '(' tokens.pop(0) while not tokens[0] == ')': te