How to build an application in Django which will handle Multiple servers accross network

2011-04-28 Thread Anurag (anu) Agarwal
Hi All, I want to build an application for one of my client which has following features 1. Client has some driver software which can be installed on Windows and Linux based systems. This driver software is fetching some operating system details using kernel level programming. 2. Now a new web ba

Re: Composition instead of inheritance

2011-04-28 Thread John Nagle
On 4/28/2011 3:35 PM, 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): http://code.activestate.com/recipes/577658-comp

PyCon Australia 2011: cfp closing soon!

2011-04-28 Thread Ryan Kelly
Hi Everyone, A reminder that the Call for Proposals for PyCon Australia 2011 will be closing soon. We've had some great proposals so far, but there is still time left and program to fill. PyCon Australia is Australia's only conference dedicated exclusively to the Python programming language, an

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 '#!

Re: Composition instead of inheritance

2011-04-28 Thread Ian Kelly
On Thu, Apr 28, 2011 at 11:15 AM, 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/

Re: use of index (beginner's question)

2011-04-28 Thread Daniel Kluev
On Thu, Apr 28, 2011 at 11:42 AM, Rusty Scalf 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 way to g

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Dan Stromberg writes: > On Thu, Apr 28, 2011 at 3:35 PM, 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 n

Re: Composition instead of inheritance

2011-04-28 Thread Dan Stromberg
On Thu, Apr 28, 2011 at 3:35 PM, 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): >> >> http://code.activestate.c

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Steven D'Aprano 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 delegation. As in, when one object

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Ethan Furman 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 ideas for

Re: Composition instead of inheritance

2011-04-28 Thread James Mills
On Fri, Apr 29, 2011 at 11:43 AM, Ethan Furman 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 this is typical of

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): >> >> http://code.activesta

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: 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 fo

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 ide

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 wi

回复: 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 发送时间: 2011-04-28 21:26 主 题: Re: Need your help 收件人: python-list@python.org Am 28.04.2011 13:14, schrieb Chris Rebert: > import a, b, sys > def c(): > ori

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 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 is pointing

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 descr

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 5:17 pm, Andrew Berg 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" > > The ke

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 3:11 pm, Uncle Ben wrote: > On Apr 28, 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 feat

Re: [OT] VCS tools

2011-04-28 Thread Daniel Kluev
On Fri, Apr 29, 2011 at 8:50 AM, Ben Finney wrote: > Martin Schöön 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 as one's needs with it grow. > When I was de

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: 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 pa

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): > > http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-mult

Re: NaN

2011-04-28 Thread Grant Edwards
On 2011-04-28, Steven D'Aprano 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 statistics language R has a specific

Re: [OT] VCS tools

2011-04-28 Thread Ben Finney
Martin Schöön 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 looking at Mercurial.

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. You?

Re: Composition instead of inheritance

2011-04-28 Thread Ben Finney
Ethan Furman 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 welcome! It doesn'

Re: Read-write lock for Python

2011-04-28 Thread Ben Finney
Geoff Bache 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, including two langui

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 sta

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 an

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 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 su

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 access

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 access

Re: use of index (beginner's question)

2011-04-28 Thread Rhodri James
On Thu, 28 Apr 2011 01:49:33 +0100, Chris Angelico wrote: On Thu, Apr 28, 2011 at 10:42 AM, Rusty Scalf 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 with the value "list2"; this is n

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: NaN

2011-04-28 Thread Grant Edwards
On 2011-04-28, 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. > > FWICT, it's useful in lower-level languages (which typically lack > exceptions and often lack nice ways of returning multiple values from > a

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 wrote: > On Thu, 28 Apr 2011 19:14:45 +0200 > Geoff Bache wrote: >> On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant >> wrote: >> > What about >> > >> > http://docs.python.org/library/threading.html#lock-objects >> >> Those aren't read-writ

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 3:29 pm, MRAB wrote: > On 28/04/2011 20:11, Uncle Ben wrote: > > > > > On Apr 28, 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

Re: Deditor

2011-04-28 Thread Kruptein
On 28 apr, 07:46, jmfauth wrote: > On 27 avr, 19:22, Alec Taylor 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 libs, adatpt the "import" > -

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: 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(): primary.ou

Re: Have you read the Python docs lately?

2011-04-28 Thread Vinay Sajip
On Apr 28, 12:40 am, Ben Finney 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 commented on early drafts, wh

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 f

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 messa

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 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 responding t

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 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

Re: IDLE lost from Windows menu !

2011-04-28 Thread Uncle Ben
On Apr 28, 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

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 t

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: 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 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) fin

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 wrote: > On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant > wrote: > > What about > > > > http://docs.python.org/library/threading.html#lock-objects > > Those aren't read-write locks. They are basic locks, which don't > distinguish between rea

Re: Composition instead of inheritance

2011-04-28 Thread Eric Snow
On Thu, Apr 28, 2011 at 11:15 AM, 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-inheri

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? -- http://mail.python.org/

Re: NaN

2011-04-28 Thread Eric Snow
On Thu, Apr 28, 2011 at 11:01 AM, Chris Rebert wrote: > On Thu, Apr 28, 2011 at 9:21 AM, Eric Snow > 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

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

2011-04-28 Thread Duncan Booth
Albert van der Horst 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 you'll find Python 3.x

Re: Read-write lock for Python

2011-04-28 Thread Geoff Bache
On Thu, Apr 28, 2011 at 4:28 PM, Jean-Michel Pichavant 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 competing exa

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, s

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 > wrote: >> In article , >> Alec Taylor   wrote: >>>Geany I've tried in the past, it's really buggy on my home computer >>>and at Uni... however from my phone it

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~ -- http://mail.python.org/mailma

Re: NaN

2011-04-28 Thread Chris Rebert
On Thu, Apr 28, 2011 at 9:21 AM, Eric Snow 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 with NaN. >  However, I ha

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: Have you read the Python docs lately?

2011-04-28 Thread Raymond Hettinger
On Apr 27, 11:28 pm, Paul Rubin wrote: > Raymond Hettinger 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 especi

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

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 P

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:

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 ipa

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 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. > >Didn't someone alre

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

2011-04-28 Thread Albert van der Horst
In article , Grant Edwards wrote: > >On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes wrote: >> Am 18.04.2011 21:58, schrieb John Nagle: >>> ?? ?? This is typical for languages which backed into a "bool" type, >>> rather than having one designed in. ??The usual result is a boolean >>> type with

Re: Python IDE/text-editor

2011-04-28 Thread Albert van der Horst
In article , Alec Taylor 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 on the #python channel on Freenode... >however I've never been able

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 ca

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 rando

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 abstracts

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 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 发送时间: 2011-04-28 20:42 主 题: Re: Need your help 收件人: 1011_wxy <1011_...@163.com> 抄 送: "python-list@python.org" 1011_

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 -- http://m

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 ca

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 >

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 func

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

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 informati

Re: use of index (beginner's question)

2011-04-28 Thread Graeme Glass
On Apr 28, 5:32 am, Algis Kabaila 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" +

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 > >

Re: How to upload a file

2011-04-28 Thread Gabriel Genellina
En Wed, 27 Apr 2011 11:14:54 -0300, Torsten Bronger 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 http://stackoverflow.com/questions/68477/send-file-using-post-from-a

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 s

Re: Access violation reading 0x00000010

2011-04-28 Thread Gabriel Genellina
En Thu, 28 Apr 2011 03:35:48 -0300, yuan zheng 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 fault when invoking this a

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 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 declared with other types (e.g.

Re: use of index (beginner's question)

2011-04-28 Thread Iain King
On Apr 28, 2:45 am, Chris Angelico 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. > > Chris Ang

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 s

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 > 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 fau

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 >

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 examp

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 call

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 months