Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Richard Heathfield
In , Alf P. Steinbach wrote: > I'm very very happy that most comments about perceived defects in > the text and in my responses here, have only disagreements over > terminology. I had expected a slew of errors being pointed out, > since I'm new to Python. Still, I'm fairly sure that there > ac

Re: How can module determine its own path?

2009-10-30 Thread Stef Mientki
Robert Kern wrote: On 2009-10-30 18:40 PM, Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for modules launched with

Re: How can module determine its own path?

2009-10-30 Thread Robert Kern
Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 18:40 PM, Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for m

Problems with cx_Oracle and Oracle 11.1 on Windows

2009-10-30 Thread ron.re...@gmail.com
Hi, I am trying to use cx_Oracle and SQLAlchemy with Oracle 11gR1 (11.1) on Windows Vista 64 bit. When I import cx_Oracle, I get this error: >>> import cx_Oracle Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: %1 is not a valid Win32 application. I have a

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread alex23
"Alf P. Steinbach" wrote: > And no, I didn't do any research on that. If it mattered more (e.g. appearing > as > statement in the text) I'd have done that. The nice thing about Usenet is that > people rush in to correct things. ;-) http://xkcd.com/386/> Unfortunately, the idiocy people say on th

Re: list comprehension problem

2009-10-30 Thread alex23
Terry Reedy wrote: > alex23 wrote: > > You're completely wrong. Immutability has nothing to do with identity, > > which is what 'is' is testing for: > > What immutability has to do with identity is that 'two' immutable > objects with the same value *may* actually be the same object, > *depending o

Re: How can module determine its own path?

2009-10-30 Thread Steven D'Aprano
On Sat, 31 Oct 2009 00:40:59 +0100, Stef Mientki wrote: > Robert Kern wrote: >> On 2009-10-30 12:19 PM, kj wrote: >>> How can a module determine the path of the file that defines it? (Note >>> that this is, in the general case, different from sys.argv[0].) >> >> __file__ >> > but for modules launc

Re: How can module determine its own path?

2009-10-30 Thread Steven D'Aprano
On Fri, 30 Oct 2009 20:08:28 -0500, Robert Kern wrote: > Stef Mientki wrote: ... >> but how do I configure a "properly initialized namespace dict" (other >> than my current namespace) ? > > filename = '...' > ns = dict( > __file__=filename, > __name__='whatever_you_need_it_to_be', __bu

Re: self.__dict__ tricks

2009-10-30 Thread Steven D'Aprano
On Fri, 30 Oct 2009 11:16:29 -0500, Tim Johnson wrote: > On 2009-10-30, Steven D'Aprano > wrote: >> >> Could you explain what problem you are trying to solve? >> >> >>> class formLoader(): > > Hi Steve > In a nutshell: > The 'problem' is to parse a form in such a way that tags which are t

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* alex23: "Alf P. Steinbach" wrote: And no, I didn't do any research on that. If it mattered more (e.g. appearing as statement in the text) I'd have done that. The nice thing about Usenet is that people rush in to correct things. ;-) http://xkcd.com/386/> Unfortunately, the idiocy people say

Re: How to avoid certain directories when using os.walk?

2009-10-30 Thread Dave Angel
Sean DiZazzo wrote: On Oct 29, 10:17 pm, Chris Rebert wrote: On Thu, Oct 29, 2009 at 9:53 PM, Peng Yu wrote: I don't see a way to avoid walking over directories of certain names with os.walk. For example, I don't want os.walk return files whose path include '/backup/'. Is there a way

Re: How can module determine its own path?

2009-10-30 Thread Dave Angel
Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for modules launched with execfile, __file__ doesn't exists. cheers,

Re: How to avoid certain directories when using os.walk?

2009-10-30 Thread Gabriel Genellina
En Fri, 30 Oct 2009 14:50:34 -0300, Sean DiZazzo escribió: On Oct 29, 10:17 pm, Chris Rebert wrote: On Thu, Oct 29, 2009 at 9:53 PM, Peng Yu wrote: > I don't see a way to avoid walking over directories of certain names > with os.walk. For example, I don't want os.walk return files whose >

Re: How can module determine its own path?

2009-10-30 Thread Gabriel Genellina
En Fri, 30 Oct 2009 20:40:59 -0300, Stef Mientki escribió: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for modules launched with ex

How to get output of command called by os.system()?

2009-10-30 Thread Peng Yu
I need to integrate shell program with python. I'm wondering if there is a way get the output of the shell program called by os.system(). Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get output of command called by os.system()?

2009-10-30 Thread Chris Rebert
On Fri, Oct 30, 2009 at 11:09 PM, Peng Yu wrote: > I need to integrate shell program with python. I'm wondering if there > is a way get the output of the shell program called by os.system(). You'd probably do better to use the `subprocess` module instead: http://docs.python.org/library/subprocess

<    1   2