PyOhio (July 30-31) Call for Proposals; due June 3

2011-04-28 Thread Catherine Devlin
PyOhio 2011, the fourth annual Python programming conference for Ohio and the surrounding region, will take place Saturday-Sunday, July 30-31, 2011 at the Ohio State University in Columbus, Ohio. A variety of activities are planned, including tutorials, scheduled talks, Lightning Talks, Open

Re: ElementTree XML parsing problem

2011-04-28 Thread Stefan Behnel
Hegedüs Ervin, 27.04.2011 21:33: hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records record id=001 education=High

Re: Access violation reading 0x00000010

2011-04-28 Thread yuan zheng
libcommon = CDLL(c:\libcommon-0.dll, RTLD_GLOBAL) libcommon.SIM_init() - This is the invoking. thanks, yuanzheng. 2011/4/28 Chris Angelico ros...@gmail.com On Thu, Apr 28, 2011 at 1:00 PM, yuan zheng tsinghuayua...@gmail.com wrote: Hi, everyone. I have a question when I invoke

Re: Access violation reading 0x00000010

2011-04-28 Thread Chris Angelico
On Thu, Apr 28, 2011 at 4:01 PM, yuan zheng tsinghuayua...@gmail.com wrote: libcommon = CDLL(c:\libcommon-0.dll, RTLD_GLOBAL) libcommon.SIM_init() - This is the invoking. When you have a backslash in a literal string, you need to double it: libcommon = CDLL(c:\\libcommon-0.dll,

Re: ElementTree XML parsing problem

2011-04-28 Thread Ervin Hegedüs
hello, On Thu, Apr 28, 2011 at 07:57:28AM +0200, Stefan Behnel wrote: So, I started change the codepage mark of xml: ?xml version=1.0 encoding=UTF-8 ? - same result ?xml version=1.0 encoding=ISO-8859-2 ? - same result ?xml version=1.0 encoding=ISO-8859-1 ? - same result You probably

Re: Have you read the Python docs lately?

2011-04-28 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: A number of developers have been working on adding examples and useful advice to the docs. To sharpen your skills, here are some pieces of recommended reading: Thanks, those are nice. The logging one looks especially useful. The module always looked

Re: Access violation reading 0x00000010

2011-04-28 Thread yuan zheng
Sorry , the path is just an example. This is not the question I think. Because there is lots of api in libcommon-0.dll, and there is no fault when invoking other api, such as libcommon.SIM_start().. It's just fault when invoking this api - SIM_init(). So I wanna which situation would lead to this

Re: Have you read the Python docs lately?

2011-04-28 Thread Terry Reedy
On 4/27/2011 7:40 PM, Ben Finney wrote: http://docs.python.org/dev/howto/logging.html This one in particular was sorely needed, especially its early if-then discussion of whether to use ‘logging’ at all. Thanks very much to Vinay Sajip. Yes, he has been working pretty steadily for some

Re: Reliably call code after object no longer exists or is unreachable?

2011-04-28 Thread Gregory Ewing
Jack Bates wrote: Python's __del__ or destructor method works (above) - but only in the absence of reference cycles (below). An object, with a __del__ method, in a reference cycle, causes all objects in the cycle to be uncollectable. Store a weak reference to the object somewhere with a

argparse parser stores lists instead of strings

2011-04-28 Thread Andrew Berg
I've set up groups of arguments for a script I'm writing, and any time I give an argument a value, it gets stored as a list instead of a string, even if I explicitly tell it to store a string. Arguments declared with other types (e.g. float, int) and default values are stored as expected. For

Re: unpickling derived LogRecord in python 2.7 from python2.6

2011-04-28 Thread Peter Otten
Vinay Sajip wrote: On Apr 27, 5:41 pm, Peter Otten __pete...@web.de wrote: The Problem is that as of Python 2.7logging.LogRecord has become a newstyle class which is pickled/unpickled differently. I don't know if there is an official way to do the conversion, but here's what I've hacked

Re: Access violation reading 0x00000010

2011-04-28 Thread yuan zheng
I have found my question's answer. The fault is sourced from the implement of SIM_init(). Thanks a lot. thanks, yuanzheng. 2011/4/28 yuan zheng tsinghuayua...@gmail.com Sorry , the path is just an example. This is not the question I think. Because there is lots of api in

Re: argparse parser stores lists instead of strings

2011-04-28 Thread Peter Otten
Andrew Berg wrote: I've set up groups of arguments for a script I'm writing, and any time I give an argument a value, it gets stored as a list instead of a string, even if I explicitly tell it to store a string. Arguments declared with other types (e.g. float, int) and default values are

Re: use of index (beginner's question)

2011-04-28 Thread Iain King
On Apr 28, 2:45 am, Chris Angelico ros...@gmail.com wrote: Incidentally, you're allowed to put the comma on the last item too:  lists = [   ['pig', 'horse', 'moose'],   ['62327', '49123', '79115'], ] Often makes for easier maintenance, especially when you append array/list elements.

Re: argparse parser stores lists instead of strings

2011-04-28 Thread Gabriel Genellina
En Thu, 28 Apr 2011 04:24:46 -0300, Andrew Berg bahamutzero8...@gmail.com escribió: I've set up groups of arguments for a script I'm writing, and any time I give an argument a value, it gets stored as a list instead of a string, even if I explicitly tell it to store a string. Arguments

Re: Access violation reading 0x00000010

2011-04-28 Thread Gabriel Genellina
En Thu, 28 Apr 2011 03:35:48 -0300, yuan zheng tsinghuayua...@gmail.com escribió: Sorry , the path is just an example. This is not the question I think. Because there is lots of api in libcommon-0.dll, and there is no fault when invoking other api, such as libcommon.SIM_start().. It's just

Spurious character in IOError exception

2011-04-28 Thread loial
When I correctly trap an IOError a spurious u' appears in the file path in the exception message : The path used in the code is correct i.e. /home/myfile But the error message says : [Errno 2] No such file or directory: u'/home/myfile' I am simply doing except IOError, e: print

Re: How to upload a file

2011-04-28 Thread Gabriel Genellina
En Wed, 27 Apr 2011 11:14:54 -0300, Torsten Bronger bron...@physik.rwth-aachen.de escribió: Hallöchen! I'm skimming through the various recipies for uploading a file via HTTP. Unfortunately, all of them are awkward but also rather old. (See for example

Re: Spurious character in IOError exception

2011-04-28 Thread Peter Otten
loial wrote: When I correctly trap an IOError a spurious u' appears in the file path in the exception message : The path used in the code is correct i.e. /home/myfile But the error message says : [Errno 2] No such file or directory: u'/home/myfile' I am simply doing except

Re: use of index (beginner's question)

2011-04-28 Thread Graeme Glass
On Apr 28, 5:32 am, Algis Kabaila akaba...@pcug.org.au wrote: On Thursday 28 April 2011 11:23:51 Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: Rusty Scalf wrote: list1 = ['pig', 'horse', 'moose'] list2 =  ['62327', '49123', '79115'] n = 2 s2 = list + `n` list + 'n'

Need your help

2011-04-28 Thread 1011_wxy
Hi friends: Here I need some help. #encoding=utf-8 #moudle a.py def a(): print function a! #encoding=utf-8 #moudle b.py def b(): print function b! #encoding=utf-8 #moudle c.py import a import b def c(): a.a() b.b() Here in function c,How can i record all the information

Re: Need your help

2011-04-28 Thread Chris Rebert
On Wed, Apr 27, 2011 at 10:38 PM, 1011_wxy 1011_...@163.com wrote: Hi friends: Here I need some help. #encoding=utf-8 #moudle a.py def a():     print function a! #encoding=utf-8 #moudle b.py def b():     print function b! #encoding=utf-8 #moudle c.py import a import b def

Re: Need your help

2011-04-28 Thread Ervin Hegedüs
hello, Here I need some help. #encoding=utf-8 #moudle a.py def a(): print function a! #encoding=utf-8 #moudle b.py def b(): print function b! #encoding=utf-8 #moudle c.py import a import b def c(): a.a() b.b() Here in function c,How can i record all the

Re: Need your help

2011-04-28 Thread Ervin Hegedüs
hello, On Thu, Apr 28, 2011 at 01:20:16PM +0200, Ervin Hegedüs wrote: #!/usr/bin/python import a import b import sys import StringIO output = StringIO.StringIO() def c(): # save default stdout tout = sys.stdout # redirect stdout to StringIO object sys.stdout =

Re: Need your help

2011-04-28 Thread Jean-Michel Pichavant
1011_wxy wrote: Hi friends: Here I need some help. #encoding=utf-8 #moudle a.py def a(): print function a! #encoding=utf-8 #moudle b.py def b(): print function b! #encoding=utf-8 #moudle c.py import a import b def c(): a.a() b.b() Here in function c,How can i

High respected career - Careers in next month

2011-04-28 Thread gaurav
Potential income in Management careers. Work in Management careers. Visit: http://managementjobs.webs.com/index.htm http://jobscore.webs.com/executivemanager.htm Careers for Management - Careers in next month http://employmentsmanagement.blogspot.com/ http://rojgars1.webs.com/gov.htm --

回复: Re: Need your help

2011-04-28 Thread 1011_wxy
Hi JM: python c.py afile.log could you pls give me the whole example? I am so sorry that I am a beginner in Python. 2011-04-28 1011_wxy 发件人: Jean-Michel Pichavant jeanmic...@sequans.com 发送时间: 2011-04-28 20:42 主 题: Re: Need your help 收件人: 1011_wxy 1011_...@163.com 抄 送:

Re: 回复: Re: Need your help

2011-04-28 Thread Jean-Michel Pichavant
1011_wxy wrote: Hi JM: *python c.py afile.log* could you pls give me the whole example? I am so sorry that I am a beginner in Python. Your module a and b that you cannot modify given your original description, are printing data using the print statement. That means these module only

Re: Need your help

2011-04-28 Thread Thomas Rachel
Am 28.04.2011 13:14, schrieb Chris Rebert: import a, b, sys def c(): orig_stdout = sys.stdout sys.stdout = open('my_log_file.log', 'w') a.a() b.b() sys.stdout.close() sys.stdout = orig_stdout Someone may have written a with-statement context manager that

Read-write lock for Python

2011-04-28 Thread Geoff Bache
Hi all, I currently find myself needing a Python read-write lock. I note that there is none in the standard library, but googling python read-write lock quickly produced 6 different competing examples, including two languishing patch proposals for the standard library. I can always pick a random

Re: Read-write lock for Python

2011-04-28 Thread Jean-Michel Pichavant
Geoff Bache wrote: Hi all, I currently find myself needing a Python read-write lock. I note that there is none in the standard library, but googling python read-write lock quickly produced 6 different competing examples, including two languishing patch proposals for the standard library. I can

Re: Python IDE/text-editor

2011-04-28 Thread Albert van der Horst
In article mailman.511.1303137613.9059.python-l...@python.org, Alec Taylor alec.tayl...@gmail.com wrote: Geany I've tried in the past, it's really buggy on my home computer and at Uni... however from my phone it works wonderfully! (Use it for C++ projects on Rhobuntu) Eric 4 was suggested to me

Re: Equivalent code to the bool() built-in function

2011-04-28 Thread Albert van der Horst
In article iok5tg$svv$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes li...@cheimes.de wrote: Am 18.04.2011 21:58, schrieb John Nagle: ?? ?? This is typical for languages which backed into a bool type, rather than having

Re: Equivalent code to the bool() built-in function

2011-04-28 Thread Albert van der Horst
In article 9142usf51...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Chris Angelico wrote: Remind me some day to finish work on my ultimate programming language, which starts out with a clean slate and lets the programmer define his own operators and everything.

socket.gethostbyaddr() wrongly returning a DNS CNAME as the 'primary' hostname

2011-04-28 Thread cjblaine
Python 2.7.1 (perhaps others) I believe this is a bug. Comments? Docs state: Return a triple (hostname, aliaslist, ipaddrlist) where hostname is the primary host name responding to the given ip_address, aliaslist is a (possibly empty) list of alternative host names for the same address, and

NaN

2011-04-28 Thread Eric Snow
There's a big discussion going on at python-dev and python-ideas about NaN (not-a-number, from IEEE 754). I haven't really gotten into any scientific computing or numeric programming so I have never knowingly dealt with NaN. However, I have read the discussions and several things are not clear:

IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
I have lost the convenient feature that to edit a .py file I could right-click on the file name and reach the menu item Edit with IDLE. The workaround is not hard, but it wouild be nice to get this feature back. It happened when I was mungeing around and downloaded Python 2.3.3 in addition to

multiprocessing: file-like object

2011-04-28 Thread buck
I've been having issues with getting a file-like object to work with multiprocessing. Since the details are quite lengthy, I've posted them on stackoverflow here: http://stackoverflow.com/questions/5821880/python-multiprocessing-synchronizing-file-like-object I hope I'm not being super rude by

Re: Have you read the Python docs lately?

2011-04-28 Thread Raymond Hettinger
On Apr 27, 11:28 pm, Paul Rubin no.em...@nospam.invalid wrote: Raymond Hettinger pyt...@rcn.com writes: A number of developers have been working on adding examples and useful advice to the docs.  To sharpen your skills, here are some pieces of recommended reading: Thanks, those are nice.  

Re: Equivalent code to the bool() built-in function

2011-04-28 Thread buck
I'm not not touching you! -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN

2011-04-28 Thread Chris Rebert
On Thu, Apr 28, 2011 at 9:21 AM, Eric Snow ericsnowcurren...@gmail.com wrote: There's a big discussion going on at python-dev and python-ideas about NaN (not-a-number, from IEEE 754).  I haven't really gotten into any scientific computing or numeric programming so I have never knowingly dealt

Composition instead of inheritance

2011-04-28 Thread Ethan Furman
For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x): http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/ Comments welcome! ~Ethan~ --

Re: Python IDE/text-editor

2011-04-28 Thread Alec Taylor
Your probably right. I suppose I'll just wait till I finish my fooIDE project On Fri, Apr 29, 2011 at 2:21 AM, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: In article mailman.511.1303137613.9059.python-l...@python.org, Alec Taylor  alec.tayl...@gmail.com wrote: Geany I've tried in

Re: use of index (beginner's question) (Iain King)

2011-04-28 Thread Apprentice3D
Envoyé de mon iPad Le 2011-04-28 à 4:55, python-list-requ...@python.org a écrit : Send Python-list mailing list submissions to python-list@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/python-list or, via email, send a

Re: Read-write lock for Python

2011-04-28 Thread Geoff Bache
On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Geoff Bache wrote: Hi all, I currently find myself needing a Python read-write lock. I note that there is none in the standard library, but googling python read-write lock quickly produced 6 different

Re: Equivalent code to the bool() built-in function

2011-04-28 Thread Duncan Booth
Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I guess I never thought about it, but there isn't an 'xor' operator to go along with 'or' and 'and'. Must not be something I need very often. There is. applied to booleans is xor. Best to get into the habit of using '!=' otherwise

Re: NaN

2011-04-28 Thread Eric Snow
On Thu, Apr 28, 2011 at 11:01 AM, Chris Rebert c...@rebertia.com wrote: On Thu, Apr 28, 2011 at 9:21 AM, Eric Snow ericsnowcurren...@gmail.com wrote: There's a big discussion going on at python-dev and python-ideas about NaN (not-a-number, from IEEE 754). I haven't really gotten into any

Python 3.2 Tkinter and TTK

2011-04-28 Thread steven.oldner
Just downloaded Python3.2 from python's site and attempted to run some of the examples in the 24.2.10Tk Styling. The button worked, but the menu didn't. I also tried a couple from the TKDocs web site. Only errors from there. So, what do I need to do to get it to run? --

Re: Composition instead of inheritance

2011-04-28 Thread Eric Snow
On Thu, Apr 28, 2011 at 11:15 AM, Ethan Furman et...@stoneleaf.us wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):

Re: Read-write lock for Python

2011-04-28 Thread D'Arcy J.M. Cain
On Thu, 28 Apr 2011 19:14:45 +0200 Geoff Bache geoff.ba...@gmail.com wrote: On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: What about http://docs.python.org/library/threading.html#lock-objects Those aren't read-write locks. They are basic locks,

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-28 Thread Igor Soares
On 27 abr, 21:29, MRAB pyt...@mrabarnett.plus.com wrote: On 27/04/2011 21:02, Igor Soares wrote: Reading the section 6.11. The import statement http://docs.python.org/py3k/reference/simple_stmts.html#the-import-st... I found: Import statements are executed in two steps: (1)

Re: Composition instead of inheritance

2011-04-28 Thread Jean-Michel Pichavant
Ethan Furman wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x): http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/ Comments welcome! ~Ethan~ Sounds

Re: NaN

2011-04-28 Thread Steven D'Aprano
On Thu, 28 Apr 2011 10:01:49 -0700, Chris Rebert wrote: 2. What are the use cases for NaN?  Looks like it gets used a lot as a numeric (float?) object with non-value. [...] And it's used to represent missing numeric data values, sort of like a numerical None/Null: How much does the truck

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 12:28 pm, Uncle Ben b...@greenba.com wrote: I have lost the convenient feature that to edit a .py file I could right-click on the file name and reach the menu item Edit with IDLE. The workaround is not hard, but it wouild be nice to get this feature back. It happened when I was

Re: IDLE lost from Windows menu !

2011-04-28 Thread MRAB
On 28/04/2011 20:11, Uncle Ben wrote: On Apr 28, 12:28 pm, Uncle Benb...@greenba.com wrote: I have lost the convenient feature that to edit a .py file I could right-click on the file name and reach the menu item Edit with IDLE. The workaround is not hard, but it wouild be nice to get this

Re: socket.gethostbyaddr() wrongly returning a DNS CNAME as the 'primary' hostname

2011-04-28 Thread Ned Deily
In article 850c85c0-be6e-4eec-b6b1-5c79e1716...@glegroupsg2000goo.googlegroups.com , cjblaine cjbla...@gmail.com wrote: Python 2.7.1 (perhaps others) I believe this is a bug. Comments? Docs state: Return a triple (hostname, aliaslist, ipaddrlist) where hostname is the primary host name

Zope with mySQL

2011-04-28 Thread harryjatt
Hi, i am doing web development with Zope. My connected database is mySQL. I am new to this combination.I have to upload the files to mySQL with programming in zope and then downloading them via zope.Can you help me in this regard? I will be very thankfull to you. Regards, Harry -- View this

Where to start in writing test programs for electronics

2011-04-28 Thread Manatee
I would like to write test programs that will collect data over the serial port, control instruments, plot data as its collected, and save that data to a file. I have partially figured out instrument control and have downloaded numpy and matplot. I am having trouble pulling it together as regards

Re: Have you read the Python docs lately?

2011-04-28 Thread Vinay Sajip
On Apr 28, 12:40 am, Ben Finney ben+pyt...@benfinney.id.au wrote: This one in particular was sorely needed, especially its early if-then discussion of whether to use ‘logging’ at all. For that when to use logging part, you can thank Nick Coghlan :-) Thanks are also due to all those who

Re: socket.gethostbyaddr() wrongly returning a DNS CNAME as the 'primary' hostname

2011-04-28 Thread cjblaine
Thanks for the reply, Ned. Bummer for me. Check this out: C code on Solaris 10 SPARC returns the following with nscd running (the Solaris Naming Services Caching Daemon, on by default): PRIMARY according to gethostbyaddr(): my-dns-cname.our.org ALIAS according to gethostbyaddr():

Re: Python 3.2 Tkinter and TTK

2011-04-28 Thread Jayme Proni Filho
Man, If you want to programm GUI's it is better for you learn Qt or GTK. They are so much better than tkinter. I told this with sadness because I like free things, but the reality is not like this. This libs are in all places.

Re: Deditor

2011-04-28 Thread Kruptein
On 28 apr, 07:46, jmfauth wxjmfa...@gmail.com wrote: On 27 avr, 19:22, Alec Taylor alec.tayl...@gmail.com wrote: Thanks, any plans for a Windows version? - Download the deb - Unpack it with a utility like 7zip - Throw away the unnecessary stuff, (keep the deditor part) - Depending on your

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 3:29 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 28/04/2011 20:11, Uncle Ben wrote: On Apr 28, 12:28 pm, Uncle Benb...@greenba.com  wrote: I have lost the convenient feature that to edit a .py file I could right-click on the file name and reach the menu item Edit with IDLE.

Re: Read-write lock for Python

2011-04-28 Thread Geoff Bache
On Thu, Apr 28, 2011 at 7:53 PM, D'Arcy J.M. Cain da...@druid.net wrote: On Thu, 28 Apr 2011 19:14:45 +0200 Geoff Bache geoff.ba...@gmail.com wrote: On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: What about

Re: NaN

2011-04-28 Thread Grant Edwards
On 2011-04-28, Chris Rebert c...@rebertia.com wrote: 2. What are the use cases for NaN? Looks like it gets used a lot as a numeric (float?) object with non-value. FWICT, it's useful in lower-level languages (which typically lack exceptions and often lack nice ways of returning multiple

Re: [OT] VCS tools (was Development tools and practices for Pythonistas)

2011-04-28 Thread Martin Schöön
This has been a pretty informative thread so far. Please keep it coming. I am a hardware development guy and do very little software development. I have been vaguely aware of tools for version control but inspired by this thread I have started looking at Mercurial. My humble contribution (from my

Re: use of index (beginner's question)

2011-04-28 Thread Rhodri James
On Thu, 28 Apr 2011 01:49:33 +0100, Chris Angelico ros...@gmail.com wrote: On Thu, Apr 28, 2011 at 10:42 AM, Rusty Scalf iai-...@sonic.net wrote: list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '49123', '79115'] n = 2 s2 = list + `n` a = s2[list1.index('horse')] print a s2 is a string

subclassing an extension (non built-in) class / type in python 3.2

2011-04-28 Thread Marc Gronle
Hello everybody, I read in the extending and embedding documentation of python 3, that it is easily possible to subclass or subtype a built-in type. However, in my case, I would like to subclass a class, defined in a external python-file (py), which I can import in my C++-application and

Fwd: subclassing an extension (non built-in) class / type in python 3.2

2011-04-28 Thread Marc Gronle
Hello everybody, I read in the extending and embedding documentation of python 3, that it is easily possible to subclass or subtype a built-in type. However, in my case, I would like to subclass a class, defined in a external python-file (py), which I can import in my C++-application and

Re: IDLE lost from Windows menu !

2011-04-28 Thread Andrew Berg
On 2011.04.28 02:11 PM, Uncle Ben wrote: It was suggested to me privately that I search for HKEY_CLASSES_ROOT\*\shell, right_click on shell, create a new key called EDIT with IDLE and another called command python.exe %1 The key you're looking for is HKCR\Python.File\shell. Add a subkey

Re: Python 3.2 Tkinter and TTK

2011-04-28 Thread David Phillips
If you want to programm GUI's it is better for you learn Qt or GTK. They are so much better than tkinter. I told this with sadness because I like free things, but the reality is not like this. This libs are in all places.

Re: IDLE lost from Windows menu !

2011-04-28 Thread Terry Reedy
On 4/28/2011 12:28 PM, Uncle Ben wrote: I have lost the convenient feature that to edit a .py file I could right-click on the file name and reach the menu item Edit with IDLE. The workaround is not hard, but it wouild be nice to get this feature back. It happened when I was mungeing around and

Re: NaN

2011-04-28 Thread Terry Reedy
On 4/28/2011 2:59 PM, Steven D'Aprano wrote: Still, it could be worse... I've seen a programs use to represent missing values, on the basis that nobody could ever have more than (say) 5000 invoices in the database... (I wish I was exaggerating.) All 9s in a field for missing was once

Re: Read-write lock for Python

2011-04-28 Thread Ben Finney
Geoff Bache geoff.ba...@gmail.com writes: I currently find myself needing a Python read-write lock. Please tell us what you mean by “read-write lock”. I note that there is none in the standard library, but googling python read-write lock quickly produced 6 different competing examples,

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Ethan Furman et...@stoneleaf.us writes: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x): http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/ Comments

Re: Python 3.2 Tkinter and TTK

2011-04-28 Thread Terry Reedy
On 4/28/2011 1:33 PM, steven.oldner wrote: Just downloaded Python3.2 from python's site and attempted to run some of the examples in the 24.2.10 Tk Styling. The button worked, I found 4 examples, none of which *do* anything. Perhaps they are only meant to show syntax. I am running WinXP.

Re: [OT] VCS tools

2011-04-28 Thread Ben Finney
Martin Schöön martin.sch...@gmail.com writes: This has been a pretty informative thread so far. Please keep it coming. I am a hardware development guy and do very little software development. I have been vaguely aware of tools for version control but inspired by this thread I have started

Re: NaN

2011-04-28 Thread Grant Edwards
On 2011-04-28, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: While it is common, it is also an abuse of NANs to use it to represent missing values. In Python, that's (probably) best done with None. None won't propogate through calculations to produce None's on outputs. The

Re: Composition instead of inheritance

2011-04-28 Thread Carl Banks
On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):

Re: Read-write lock for Python

2011-04-28 Thread Ryan Kelly
On Thu, 2011-04-28 at 07:02 -0700, Geoff Bache wrote: Hi all, I currently find myself needing a Python read-write lock. I note that there is none in the standard library, but googling python read-write lock quickly produced 6 different competing examples, including two languishing patch

Re: [OT] VCS tools

2011-04-28 Thread Tim Chase
On 04/28/2011 04:50 PM, Ben Finney wrote: This has been a pretty informative thread so far. Please keep it coming. I am a hardware development guy and do very little software development. I have been vaguely aware of tools for version control but inspired by this thread I have started looking at

Re: [OT] VCS tools

2011-04-28 Thread Daniel Kluev
On Fri, Apr 29, 2011 at 8:50 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: Martin Schöön martin.sch...@gmail.com writes: I seriously recommend anyone looking for a modern VCS to give Bazaar a decent trial. It's the one I've found newcomers learn most easily, and it's astoundingly flexible

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 3:11 pm, Uncle Ben b...@greenba.com wrote: On Apr 28, 12:28 pm, Uncle Ben b...@greenba.com wrote: I have lost the convenient feature that to edit a .py file I could right-click on the file name and reach the menu item Edit with IDLE. The workaround is not hard, but it wouild be

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 5:17 pm, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.04.28 02:11 PM, Uncle Ben wrote: It was suggested to me privately that I search for HKEY_CLASSES_ROOT\*\shell, right_click on shell, create a new key called EDIT with IDLE and another called command python.exe %1

Re: Composition instead of inheritance

2011-04-28 Thread Ethan Furman
Carl Banks wrote: That's not what we mean by composition. Composition is when one object calls upon another object that it owns to implement some of its behavior. Often used to model a part/whole relationship, hence the name. Hmmm. Okay -- any ideas for a better term? Something that

Re: socket.gethostbyaddr() wrongly returning a DNS CNAME as the 'primary' hostname

2011-04-28 Thread Dan Stromberg
On Thu, Apr 28, 2011 at 1:18 PM, cjblaine cjbla...@gmail.com wrote: Thanks for the reply, Ned. Bummer for me. Check this out: C code on Solaris 10 SPARC returns the following with nscd running (the Solaris Naming Services Caching Daemon, on by default): I'm guessing the IP's PTR record

回复: Re: Need your help

2011-04-28 Thread 1011_wxy
Dear Thomas,JM,Chris Rebert: I got it. Thank you very very very much. Best Regards 2011-04-29 1011_wxy 发件人: Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de 发送时间: 2011-04-28 21:26 主 题: Re: Need your help 收件人: python-list@python.org Am 28.04.2011 13:14,

Aborting Python from C code

2011-04-28 Thread Chris Angelico
In our sandboxed Python environment, I would like to be able to trigger an abort of the currently-running Python script (from a signal handler or another thread). Currently, I use PyErr_SetInterrupt() which raises KeyboardInterrupt in the script; this works for the most part, but can be bypassed

Re: Composition instead of inheritance

2011-04-28 Thread MRAB
On 29/04/2011 02:43, Ethan Furman wrote: Carl Banks wrote: That's not what we mean by composition. Composition is when one object calls upon another object that it owns to implement some of its behavior. Often used to model a part/whole relationship, hence the name. Hmmm. Okay -- any

Re: IDLE lost from Windows menu !

2011-04-28 Thread Alec Taylor
Search for the following key in regedit: HKEY_CLASSES_ROOT\*\shell Right click on “shell”, choose create new key. Name it “Edit with IDLE Create a new key below that one and call it “command.” Now double click on the (Default) value that you will find in the right hand pane, and type in the

Re: IDLE lost from Windows menu !

2011-04-28 Thread Jayme Proni Filho
I agree with MRAB because it is easy and fast solution. --- Jayme Proni Filho Skype: jaymeproni Twitter: @jaymeproni Phone: +55 - 17 - 3631 - 6576 Mobile: +55 - 17 - 9605 - 3560 e-Mail: jaymeproni at yahoo dot com

Re: Composition instead of inheritance

2011-04-28 Thread Steven D'Aprano
On Thu, 28 Apr 2011 15:35:47 -0700, Carl Banks wrote: On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):

Re: Composition instead of inheritance

2011-04-28 Thread James Mills
On Fri, Apr 29, 2011 at 11:43 AM, Ethan Furman et...@stoneleaf.us wrote: Hmmm. Okay -- any ideas for a better term?  Something that describes taking different source classes and fusing them into a new whole, possibly using single-inheritance... Frankenstein, maybe?  ;) I'd have to say that

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Ethan Furman et...@stoneleaf.us writes: Carl Banks wrote: That's not what we mean by composition. Composition is when one object calls upon another object that it owns to implement some of its behavior. Often used to model a part/whole relationship, hence the name. Hmmm. Okay -- any

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Thu, 28 Apr 2011 15:35:47 -0700, Carl Banks wrote: That's not what we mean by composition. Composition is when one object calls upon another object that it owns to implement some of its behavior. I thought that was

Re: Composition instead of inheritance

2011-04-28 Thread Dan Stromberg
On Thu, Apr 28, 2011 at 3:35 PM, Carl Banks pavlovevide...@gmail.com wrote: On Thursday, April 28, 2011 10:15:02 AM UTC-7, Ethan Furman wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Dan Stromberg drsali...@gmail.com writes: On Thu, Apr 28, 2011 at 3:35 PM, Carl Banks pavlovevide...@gmail.com wrote: That's not what we mean by composition.  Composition is when one object calls upon another object that it owns to implement some of its behavior.  Often used to model a

Re: use of index (beginner's question)

2011-04-28 Thread Daniel Kluev
On Thu, Apr 28, 2011 at 11:42 AM, Rusty Scalf iai-...@sonic.net wrote: list1 = ['pig', 'horse', 'moose'] list2 =  ['62327', '49123', '79115'] n = 2 s2 = list + `n` a = s2[list1.index('horse')] print a  -does not work While advices above are indeed right way to go in your case, there is a

Re: Composition instead of inheritance

2011-04-28 Thread Ian Kelly
On Thu, Apr 28, 2011 at 11:15 AM, Ethan Furman et...@stoneleaf.us wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):

Python RPM Package build error

2011-04-28 Thread Wells, David J
Hello List, I am attempting to build an rpm from Python-3.1.3.tar.bz2 with the included spec file from /Python-3.1.3/Misc/RPM/ and it fails with the following error: Does anyone have any ideas? # rpmbuild -ba python-3.1.spec mv: cannot stat `idle': No such file or directory + echo

  1   2   3   >