Re: [Tutor] Reading a Text File with tkFileDialog, askopenfilename+enumerate

2009-02-16 Thread Alan Gauld
"Wayne Watson" wrote If you ever get a chance to try the Moz experiment above, I'd be interested in your reaction. I no longer have Mozilla loaded - far too resource hungry. I use IE, Firefox and Chrome plus occasionally Safari on my Mac. All of them move bookmarks using simple drag n drop

[Tutor] urllib unquote

2009-02-16 Thread Norman Khine
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/FGNS40fjoTnp2zIqq73reK60%3D%0A' >>> data = urllib.unquote(data) >>> print base

Re: [Tutor] Reading a Text File with tkFileDialog, askopenfilename+enumerate

2009-02-16 Thread Lie Ryan
On Sun, 2009-02-15 at 21:29 +0100, tutor-requ...@python.org wrote: > Do you know about sequence unpacking? In an assignment statement, when > the right side is a sequence, the left side can be a list of variables > of the same length as the sequence. Then each sequence element is > assigned to one

Re: [Tutor] urllib unquote

2009-02-16 Thread Sander Sweers
On Mon, Feb 16, 2009 at 14:12, Norman Khine wrote: > Type "help", "copyright", "credits" or "license" for more information. import base64, urllib data = 'hL/FGNS40fjoTnp2zIqq73reK60%3D%0A' data = urllib.unquote(data) print base64.decodestring(data) > ???Ը???Nzv̊??z?+? > >

Re: [Tutor] Reading a Text File with tkFileDialog, askopenfilename+enumerate

2009-02-16 Thread bob gailer
Lie Ryan wrote: On Sun, 2009-02-15 at 21:29 +0100, tutor-requ...@python.org wrote: Do you know about sequence unpacking? In an assignment statement, when the right side is a sequence, the left side can be a list of variables of the same length as the sequence. Then each sequence element is a

Re: [Tutor] Reading a Text File with tkFileDialog, askopenfilename+enumerate

2009-02-16 Thread Lie Ryan
On Mon, 2009-02-16 at 09:38 -0500, bob gailer wrote: > Lie Ryan wrote: > > On Sun, 2009-02-15 at 21:29 +0100, tutor-requ...@python.org wrote: > > > > > >> Do you know about sequence unpacking? In an assignment statement, when > >> the right side is a sequence, the left side can be a list of vari

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-16 Thread David
Bill Campbell wrote: > > The ``swatch'' program, written in perl, does this by using the > gnu-tail program via a pipe using. > > gtail --follow=name --lines=1 file1 file2 ... > > Use the source Luke. > > Bill > Thanks Bill, That looks like the right tool for the job at hand. Looking at se

[Tutor] Control Variables and a Dictionary with a GUI Interface

2009-02-16 Thread Wayne Watson
Title: Signature.html I'm looking at some Tkinter GUI code that I did not write. I've about completed work to add a read/write a configuration file of data of values the users have access to. I'm somewhat familiar with the techniques of OOP from prior use of many years ago with Java, C++, and X

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-16 Thread Bill Campbell
On Mon, Feb 16, 2009, David wrote: >Bill Campbell wrote: >> >> The ``swatch'' program, written in perl, does this by using the >> gnu-tail program via a pipe using. >> >> gtail --follow=name --lines=1 file1 file2 ... >> >> Use the source Luke. >> ... >That looks like the right tool for the job

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-16 Thread Alan Gauld
"Bill Campbell" wrote There is information on regular expressions in any book on python, perl, and other scripting languages. O'Reilly has a book ``Mastering Regular Expressions'' which is probably pretty good, but I have never read it. It is pretty much the definitive reference on regex.

Re: [Tutor] Control Variables and a Dictionary with a GUI Interface

2009-02-16 Thread Alan Gauld
"Wayne Watson" wrote The question here is how is sdict being used here in terms of its need within the GUI? Probably if I had written the program from scratch, I would have made all these variables global to Sentinel_GUI. Most programmers try to avoid global variables as a general principle

[Tutor] Newton–Raphson's method

2009-02-16 Thread Jojo Mwebaze
Hello There Any body who has implemented Newton–Raphson's method for nonlinear systems of equations in python. Consider the case where we want to solve simultaneously f(x,y) = 0 g(x,y) = 0 Please assist with the code. Regards Jojo. ___ Tutor maillis

Re: [Tutor] Newton–Raphson's method

2009-02-16 Thread Chris Fuller
You should look into Numpy or ScientificPython. http://numpy.scipy.org http://dirac.cnrs-orleans.fr/plone/software/scientificpython Also, the main Python Wiki has a page devoted to numeric/scientific topics: http://wiki.python.org/moin/NumericAndScientific Cheers On Monday 16 February 2009 12:3

Re: [Tutor] *nix tail -f multiple log files with Thread

2009-02-16 Thread David
Bill Campbell wrote: > On Mon, Feb 16, 2009, David wrote: > >> Bill Campbell wrote: >> >>> The ``swatch'' program, written in perl, does this by using the >>> gnu-tail program via a pipe using. >>> >>> gtail --follow=name --lines=1 file1 file2 ... >>> >>> Use the source Luke. >>> >>>

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

2009-02-16 Thread Wayne Watson
Title: Signature.html Python doesn't like the code in the Subject (unqualified exec not allowed in function). but easily likes self.abc="22". However, I'd like to assemble the assignment as a string, as shown in Subject, and execute it. Is there a way to do this? -- Wayne Watson (

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

2009-02-16 Thread Marc Tompkins
On Mon, Feb 16, 2009 at 11:58 AM, Wayne Watson wrote: > Python doesn't like the code in the Subject (unqualified exec not allowed > in function). but easily likes self.abc="22". However, I'd like to assemble > the assignment as a string, as shown in Subject, and execute it. Is there a > way to d

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

2009-02-16 Thread Alan Gauld
"Wayne Watson" wrote Python doesn't like the code in the Subject (unqualified exec not allowed in function). but easily likes self.abc="22". We'd need to see the code and traceback to guess why... However, I'd like to assemble the assignment as a string, as shown in Subject, and execute it

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

2009-02-16 Thread spir
Le Mon, 16 Feb 2009 12:01:24 -0800, Marc Tompkins a écrit : > On Mon, Feb 16, 2009 at 11:58 AM, Wayne Watson > wrote: > > > Python doesn't like the code in the Subject (unqualified exec not allowed > > in function). but easily likes self.abc="22". However, I'd like to assemble > > the assignme

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

2009-02-16 Thread Wayne Watson
Title: Signature.html 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 setattr. How does one do it with a dictionary

Re: [Tutor] Control Variables and a Dictionary with a GUI Interface

2009-02-16 Thread Wayne Watson
Title: Signature.html Good to hear there's nothing deeper in terms of some Python OOP feature. Thanks the global tips.   I think I'll be replacing some that sdict code, so that it's less dependent upon hard coding the "user" variables. Of course, it took me a lot longer than 2 minutes to put t

[Tutor] passig parameter with CGI...

2009-02-16 Thread Spencer Parker
I am looking for a little instruction on how one would process a set of parameters being sent to it through CGI. I have a script that sends info to another script that lives on another server. The second script would then process the information that is passed to it through a parameters list in a

[Tutor] Changing the Attribute of a Variable

2009-02-16 Thread Wayne Watson
Title: Signature.html I suspect I'm in need of setattr for this in a GUI program I'm modifying. 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 us

Re: [Tutor] Changing the Attribute of a Variable

2009-02-16 Thread wesley chun
On Mon, Feb 16, 2009 at 8:24 PM, Wayne Watson wrote: > I suspect I'm in need of setattr for this in a GUI program I'm modifying. > > 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_t

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

2009-02-16 Thread Eric Dorsey
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 to repeat the last command) Is there a way to add this functionali

Re: [Tutor] Changing the Attribute of a Variable

2009-02-16 Thread Wayne Watson
Title: Signature.html Thanks for the tips. It's a 2000 line program, written by someone else. I'm not fluent in Python, yet, but making good progress in implementing new features. The various  'attr'  facilities are a bit esoteric, but look useful. The often found, by Google "x.foobar=123", exa

Re: [Tutor] Changing the Attribute of a Variable

2009-02-16 Thread Marc Tompkins
On Mon, Feb 16, 2009 at 8:24 PM, Wayne Watson wrote: > I suspect I'm in need of setattr for this in a GUI program I'm modifying. > > 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_

Re: [Tutor] urllib unquote

2009-02-16 Thread Norman Khine
Thank you, but is it possible to get the original string from this? Sander Sweers wrote: On Mon, Feb 16, 2009 at 14:12, Norman Khine wrote: Type "help", "copyright", "credits" or "license" for more information. import base64, urllib data = 'hL/FGNS40fjoTnp2zIqq73reK60%3D%0A' data = urllib.unq