Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Marc Tompkins
On Wed, Feb 18, 2009 at 7:42 PM, Wayne Watson wrote: > I took your "starter" code, and formatted it to be what I hope is an > acceptable program, Gobal_Config.py. See attached. I'm using Python 2.5.2. > I put the two modules in the same folder with it, and executed it in IDLE. I > got this: >

Re: [Tutor] confused with dates and which way to start

2009-02-18 Thread Che M
> From: jfabi...@yolo.com > To: tutor@python.org > Date: Wed, 18 Feb 2009 15:55:05 -0800 > Subject: Re: [Tutor] confused with dates and which way to start > > On Wednesday 18 February 2009 03:10:41 pm johnf wrote: > > Hi, > > > > I need to develope a routine that will provide the some dates bet

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-18 Thread Genevi�ve DIAGORN
Bonjour, Je suis absente jusqu'au 22/02/09 inclus. Cordialement. Geneviève ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-18 Thread زياد بن عبدالعزيز البا تلي
On Wed, 18 Feb 2009 20:19:56 -0700 Eric Dorsey wrote: > I did an aptitute install of ibreadline5-dev and then > did ./configure and make again, and still don't have any > functionality to be able to hit up-arrow and get a command repeated > while inside the interpreter. Any ideas? > > I don't k

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Wayne Watson
Title: Signature.html I took your "starter" code, and formatted it to be what I hope is an acceptable program, Gobal_Config.py. See attached.  I'm using Python 2.5.2. I put the two modules in the same folder with it, and executed it in IDLE. I got this:   ...   File "C:\Sandia_Meteors\New_Senti

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-18 Thread Eric Dorsey
I did an aptitute install of ibreadline5-dev and then did ./configure and make again, and still don't have any functionality to be able to hit up-arrow and get a command repeated while inside the interpreter. Any ideas? On Tue, Feb 17, 2009 at 7:24 PM, Lie Ryan wrote: > On Mon, 16 Feb 2009 22:

Re: [Tutor] Proxies/Interceptors for file-like objects

2009-02-18 Thread Kent Johnson
On Wed, Feb 18, 2009 at 7:51 PM, Emile van Sebille wrote: class open(open): > ... def mything(self): > ... print "it's my thing" Hmm. I guess this is Python 3? In 2.6, open is a function and trying to subclass it gives an error: In [10]: open Out[10]: In [11]: class myopen(op

Re: [Tutor] confused with dates and which way to start

2009-02-18 Thread Kent Johnson
On Wed, Feb 18, 2009 at 6:55 PM, johnf wrote: > thanks Kent. This appears to work. I was not aware of datetime.timedelta(). > I really think there should be a place to find this type of information. That's what the library reference is for: http://docs.python.org/library/datetime.html http://d

Re: [Tutor] Proxies/Interceptors for file-like objects

2009-02-18 Thread Oxymoron
On Thu, Feb 19, 2009 at 11:51 AM, Emile van Sebille wrote: > Oxymoron wrote: >> >> I'm trying to intercept one or more methods in file-like objects > > Shadowing perhaps? Neat stuff - but not applicable for me I think: 1. I receive the handle. I need this function in a CGI script for example, so

Re: [Tutor] Proxies/Interceptors for file-like objects

2009-02-18 Thread Emile van Sebille
Oxymoron wrote: I'm trying to intercept one or more methods in file-like objects Shadowing perhaps? >>> class open(open): ... def mything(self): ... print "it's my thing" ... >>> a = open(r'c:\testfile','wb') >>> a.mything() it's my thing >>> a.write("this is a test") >>> a.flush()

Re: [Tutor] "Ctrl-C (unix)" in python

2009-02-18 Thread Jervis Whitley
On Thu, Feb 19, 2009 at 9:44 AM, pa yo wrote: > I am running my Twitter>>Wiki bots in infinite loops but can't find > an easy way to turn them off gracefully once I have started them. At > the moment I have to go into the terminal window where they are > running and type "Ctrl-C". (I am running U

Re: [Tutor] Changing the Attribute of a Variable

2009-02-18 Thread Alan Gauld
"Wayne Watson" wrote Maybe the web documents should warn about the horrors of eval. VBG. Possibly the same is true of exec? Yes the same is true of exec and also potentially execfile. All need to be used with extreme care where there is any risk of the executed code being tampered with out

Re: [Tutor] Changing the Attribute of a Variable

2009-02-18 Thread Alan Gauld
"Wayne Watson" wrote I'll look into Quick Edit. I use Snagit to screen capture. Quick edit allows you to use the mouse to select text on the console screen then use the Enter key to copy it to the clipboard. So to paste an error message into an email simple select it with the mouse, hit

Re: [Tutor] confused with dates and which way to start

2009-02-18 Thread johnf
On Wednesday 18 February 2009 03:10:41 pm johnf wrote: > Hi, > > I need to develope a routine that will provide the some dates between a > starting date and an ending date. The dates will be used to schedule > instructors for specific class dates from the list of available dates. > Class is normal

Re: [Tutor] "Ctrl-C (unix)" in python

2009-02-18 Thread John Fouhy
2009/2/19 pa yo : > I am running my Twitter>>Wiki bots in infinite loops but can't find > an easy way to turn them off gracefully once I have started them. At > the moment I have to go into the terminal window where they are > running and type "Ctrl-C". (I am running Ubuntu 8.10 and python 2.5.2)

[Tutor] Proxies/Interceptors for file-like objects

2009-02-18 Thread Oxymoron
Hello, I'm trying to intercept one or more methods in file-like objects (in this particular case just sys.stdin really), essentially I need a decorator/proxy implemented. What's the idiomatic way to do this? Since file objects do not have a base class(?), would I need to implement all methods to

Re: [Tutor] "Ctrl-C (unix)" in python

2009-02-18 Thread W W
On Wed, Feb 18, 2009 at 4:44 PM, pa yo wrote: > I am running my Twitter>>Wiki bots in infinite loops but can't find > an easy way to turn them off gracefully once I have started them. At > the moment I have to go into the terminal window where they are > running and type "Ctrl-C". (I am running

Re: [Tutor] confused with dates and which way to start

2009-02-18 Thread Kent Johnson
On Wed, Feb 18, 2009 at 6:10 PM, johnf wrote: > Hi, > > I need to develope a routine that will provide the some dates between a > starting date and an ending date. The dates will be used to schedule > instructors for specific class dates from the list of available dates. > Class is normally on Mo

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Marc Tompkins
On Wed, Feb 18, 2009 at 2:57 PM, Wayne Watson wrote: > Thanks. I recall installing several libraries though, where somehow they > were packaged to automatically install when opened. > > In the >

[Tutor] confused with dates and which way to start

2009-02-18 Thread johnf
Hi, I need to develope a routine that will provide the some dates between a starting date and an ending date. The dates will be used to schedule instructors for specific class dates from the list of available dates. Class is normally on Monday, Wedesday, and Friday (or any days of the week

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Wayne Watson
Title: Signature.html Thanks. I recall installing several libraries though, where somehow they were packaged to automatically install when opened. In the description, I do not see much of an explanations of examples of items like, integer(min=0, default=0). It looks like they may be called c

[Tutor] "Ctrl-C (unix)" in python

2009-02-18 Thread pa yo
I am running my Twitter>>Wiki bots in infinite loops but can't find an easy way to turn them off gracefully once I have started them. At the moment I have to go into the terminal window where they are running and type "Ctrl-C". (I am running Ubuntu 8.10 and python 2.5.2) I was thinking that I cou

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Marc Tompkins
On Wed, Feb 18, 2009 at 1:01 PM, Wayne Watson wrote: > OK, I got the ObjectConfig and Validate downloads, and copied your Global > class successfully. Don't I need to get the two files into Python as a > module? How does that work? > Simplest: put them in the same folder as your own program. Mo

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Wayne Watson
Title: Signature.html OK, I got the ObjectConfig and Validate downloads, and copied your Global class successfully. Don't I need to get the two files into Python as a module? How does that work? Marc Tompkins wrote: On Wed, Feb 18, 2009 at 7:30 AM, Wayne Watson

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Marc Tompkins
On Wed, Feb 18, 2009 at 7:30 AM, Wayne Watson wrote: > See Subject. I've run across a 58 page document > , > but am uncertain of its applicability to my present needs (see my thread on > "Changin

[Tutor] Looking for ConfigObj Documentation

2009-02-18 Thread Wayne Watson
Title: Signature.html See Subject. I've run across a 58 page document , but am uncertain of its applicability to my present needs (see my thread on "Changing the Attribute"). Usually, I end up with some 3-4 page document, so this raises an eyebrow. Am I on the right trail? In the meantime, I th

Re: [Tutor] Changing the Attribute of a Variable

2009-02-18 Thread Wayne Watson
Title: Signature.html Thanks. I'm onboard with the changes Marc and you, as below, suggest, and will very, very likely grab onto ConfigObj. I'll look into Quick Edit. I use Snagit to screen capture. One of the most useful tools I've come across in a long time. The real meat to this code is no

Re: [Tutor] Changing the Attribute of a Variable

2009-02-18 Thread Wayne Watson
Title: Signature.html Thanks very much for the comments. Definitely food for thought and helpful. I'll review them more completely  later today. I'd say chances of me switching to ConfigObj are high. Yes, about config_var_list was supposed to be a list. That was caused by confusion over synta

Re: [Tutor] Changing the Attribute of a Variable

2009-02-18 Thread Martin Walsh
Marc Tompkins wrote: > Also - config_var_list is a tuple of lists. (I'm guessing you intended > to make it a list of lists - that's what the name indicates, after all - > but putting it between "( )" makes it a tuple.) Sound advice, but a subtle clarification is warranted I think. It's the comm

Re: [Tutor] Changing the Attribute of a Variable

2009-02-18 Thread Marc Tompkins
On Tue, Feb 17, 2009 at 7:09 PM, Wayne Watson wrote: I have a few notes, but first I just have to say: you're working very hard to implement an ordered dictionary, and you really, really don't need to. Python's (unordered) dictionaries work just fine for reading and writing configurations; you jus