Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Wayne Watson
Yes, on F3 (ctrl-F). I use it a lot.  After the dust clears on how to correct this implementation, I'll give ConfigObj more consideration.  (I think a subsequent post I made with two images in it showing the layout of the program in action got side tracked here. I got a msg from the list, sayin

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

2009-02-17 Thread Lie Ryan
On Mon, 16 Feb 2009 22:34:23 -0700, Eric Dorsey wrote: > Greetings Tutor: > I've managed to install Python 2.6 on my Ubuntu VM from source, however, > it looks as though I missed something important along the way. My 2.6 > interpreter does not have readline support (example: I cant hit up arrow >

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Marc Tompkins
On Tue, Feb 17, 2009 at 11:01 AM, Wayne Watson wrote: > Here's the print from the code line below. > > Second line from the top. > There it is - stop_time is a str at this point in the program, so has no strftime attribute or method. Step back through your code and see why... I find Control-F

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Kent Johnson
On Tue, Feb 17, 2009 at 7:44 AM, Wayne Watson wrote: > ==OpenConfigFile== > def OpenConfigFile(self): > def time_tuple(tstring): > t = tstring.split(':') > print 'here is t', t > tnum = () > for j in range(0,len(t)): >

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Wayne Watson
Title: Signature.html Yes, about public scrutiny of code and your paragraphs on "Everything.." and "However, not all..."-- both  understood. Here's the print from the code line below. Second line from the top. Regarding, ConfigObj, I was aware of it when I decided to go this route. That's t

Re: [Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread python
Alan, > But don't forget that in python you can return multiple values from a > function. Yes. Thank you! Malcolm ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread Alan Gauld
wrote No, not a simple way at least. Possibly you can do it with hackery involving stack frames but I wouldn't recommend that. Either pass the values in some kind of container (list, dict, class instance) or return the new value and assign it in the caller. That's what I thought. Thank you!

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread wesley chun
> # Date vars should be type datetime.time > config_value = str(stime) this is pretty much the offending code right here... in fact, the comment contradicts the assignment. it says that date vars should be of type datetime.time, yet it assigns a *string* to config_value

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Marc Tompkins
On Tue, Feb 17, 2009 at 4:44 AM, Wayne Watson wrote: > Note that the diagnostic output in the image shows attributeError: 'str' > object has no attribute 'strftime'. > > Let me see if I clarify what's really going on by including some of the > code. > Everything in Python - both variables and cod

Re: [Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread python
Kent, > No, not a simple way at least. Possibly you can do it with hackery involving stack frames but I wouldn't recommend that. Either pass the values in some kind of container (list, dict, class instance) or return the new value and assign it in the caller. That's what I thought. Thank you! Ma

Re: [Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread Kent Johnson
On Tue, Feb 17, 2009 at 11:57 AM, wrote: > Is there a way to change values of scalar function parameters? I know you > can change the values of parameters if the parameter is a mutable type like > a list, but is there a way to update the value of scalar parameters of type > integer or string? > >

[Tutor] Possible to change values of scalar function parameters?

2009-02-17 Thread python
Is there a way to change values of scalar function parameters? I know you can change the values of parameters if the parameter is a mutable type like a list, but is there a way to update the value of scalar parameters of type integer or string? Simple example: Is there a way to have the following f

Re: [Tutor] urllib unquote

2009-02-17 Thread Norman Khine
it is my error, the data is a sha string and it is not possible to get the string back, unless you use rainbowtables or something of the sort. Kent Johnson wrote: On Mon, Feb 16, 2009 at 8:12 AM, Norman Khine wrote: Hello, Can someone point me in the right direction. I would like to return th

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Wayne Watson
Note that the diagnostic output in the image shows attributeError: 'str' object has no attribute 'strftime'. Let me see if I clarify what's really going on by including some of the code. In Sentinel_GUI, the mainloop, the code shows (hard coded default values): ... self.slowdown

Re: [Tutor] urllib unquote

2009-02-17 Thread Kent Johnson
On Mon, Feb 16, 2009 at 8:12 AM, Norman Khine wrote: > Hello, > Can someone point me in the right direction. I would like to return the > string for the following: > > Type "help", "copyright", "credits" or "license" for more information. import base64, urllib data = 'hL/FGNS40fjoTnp2zIq

Re: [Tutor] exec "self.abc=22" ?

2009-02-17 Thread Kent Johnson
On Mon, Feb 16, 2009 at 4:01 PM, Wayne Watson wrote: > I see Marc covered it with setattr. How does one do it with a dictionary? Instead of trying to create variables with variable names, use the names as keys in a dict. So instead of exec "self.abc=22" you might use self.values = {} self.

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

2009-02-17 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-17 Thread زياد بن عبدالعزيز البا تلي
On Mon, 16 Feb 2009 22:34:23 -0700 Eric Dorsey wrote: > Greetings Tutor: > I've managed to install Python 2.6 on my Ubuntu VM from source, > however, it looks as though I missed something important along the > way. My 2.6 interpreter does not have readline support (example: I > cant hit up arrow

Re: [Tutor] urllib unquote

2009-02-17 Thread Senthil Kumaran
On Tue, Feb 17, 2009 at 1:24 PM, Norman Khine wrote: > Thank you, but is it possible to get the original string from this? What do you mean by the original string Norman? Look at these definitions: Quoted String: In the different parts of the URL, there are set of characters, for e.g. space cha

Re: [Tutor] urllib unquote

2009-02-17 Thread Sander Sweers
On Tue, Feb 17, 2009 at 08:54, Norman Khine wrote: > Thank you, but is it possible to get the original string from this? You mean something like this? >>> urllib.quote('hL/FGNS40fjoTnp2zIqq73reK60=\n') 'hL/FGNS40fjoTnp2zIqq73reK60%3D%0A' Greets Sander ___

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread Marc Tompkins
On Tue, Feb 17, 2009 at 12:16 AM, wesley chun wrote: > marc: i will slightly disagree with you with regards to strftime *not* > being an attribute. it *is* an attribute, just not a *data > attribute*... i call it a "function attribute," but that's just > terminology. any time you have an object x

Re: [Tutor] exec "self.abc=22" ?

2009-02-17 Thread Andre Engels
On Mon, Feb 16, 2009 at 10:01 PM, Wayne Watson wrote: > My limited repertoire. Actually, there wasn't much of a traceback. It came > up in a small OK dialog. I copied what I could. I see my image I used above > did make it to the list, so here's the skinny. > > > I see Marc covered it with setatt

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

2009-02-17 Thread spir
Le Mon, 16 Feb 2009 22:34:23 -0700, Eric Dorsey a écrit : > Greetings Tutor: > I've managed to install Python 2.6 on my Ubuntu VM from source, however, it > looks as though I missed something important along the way. My 2.6 > interpreter does not have readline support (example: I cant hit up arr

Re: [Tutor] Changing the Attribute of a Variable

2009-02-17 Thread wesley chun
>> Initally, a variable. self.stop_time is created as type datetime.time, >> with the default value 06:00:00, a time stamp, during entry into the >> mainloop. self.stop_time = datetime.time(10,10,10). The user reads his >> configuration file with the time stamp value of 08:00:00. self.time_stop >>