Re: [Tutor] wxPython / Tkinter Grid

2005-04-01 Thread Liam Clarke
Thanks for the feedback. I should clarify - I find wxPython restrictive & fiddly in terms of trying to use a fully featured set of widgets, which are written in C++, trying to use them through a not overly documented Python wrapper. I love Pythoncard more and more. Regards, Liam Clarke On Apr

Re: [Tutor] random import errors?

2005-04-01 Thread Jeff Shannon
On Apr 1, 2005 3:20 PM, Jay Loden <[EMAIL PROTECTED]> wrote: > I have a python script that runs on my webserver every fifteen minutes. It > has run for several months with absolutely no problems. Suddenly, yesterday > morning I got an email from cron with an import error for sre_constants (see >

Re: [Tutor] Launching a file browser

2005-04-01 Thread Jeff Shannon
On Mar 31, 2005 2:14 PM, Mike Hall <[EMAIL PROTECTED]> wrote: > > >> It's been too long since I used Python on MacOSX, but IIRC you can't > >> just run a Python GUI program from the shell. Or something like > >> that...you should ask this one on the python-mac SIG mailing list: > >> http://www.pyt

Re: [Tutor] how to setup gnu.py

2005-04-01 Thread Luis N
I grabbed this from the docs: Gnuplot.py uses Python distutils and can be installed by untarring the package, changing into the top-level directory, and typing "python setup.py install". The Gnuplot.py package is pure Python--no compilation is necessary. On Mar 30, 2005 11:13 PM, jrlen balane <[

[Tutor] random import errors?

2005-04-01 Thread Jay Loden
I have a python script that runs on my webserver every fifteen minutes. It has run for several months with absolutely no problems. Suddenly, yesterday morning I got an email from cron with an import error for sre_constants (see below) I logged in with ssh, manually ran the script and got the

[Tutor] Re: Module Loop doesn't work (Joseph Q.)

2005-04-01 Thread Andrei
Joseph Quigley wrote on Fri, 01 Apr 2005 10:07:08 -0600: > I have some code on a geek dictionary that I'm making where the command > geeker() opens a module for the "real" geek dictionary (where you can type > a word to see what it is geekified). Supposedly, you type lobby() to go > back to w

[Tutor] Module Loop doesn't work (Joseph Q.)

2005-04-01 Thread Joseph Quigley
Hi,  I have some code on a geek dictionary that I'm making where the command geeker() opens a module for the "real" geek dictionary (where you can type a word to see what it is geekified). Supposedly, you type lobby() to go back to what I call  the lobby (where you can get info on the web site an

Re: [Tutor] Sorting more than one list

2005-04-01 Thread Alan Gauld
> Yikes! Alan must have been up too late. They are not the same at all. > Alan's code creates a list containing *every combination* of one > element from each source list: Oops! Blush... Lack of testing I'm afraid, I checked the syntax worked but not the actual results! Thing is, I knew about zip

Re: [Tutor] A Newbie Printing Question

2005-04-01 Thread Alan Gauld
> > 1) For plain text use the old DOS trick of sending output direct > > to the PRN: file/device - I can't remember if this still works > > in XP but I can't think why not... > > The only reason I can think of is that Windows XP is not directly based on > DOS, wereas the other versions were.

Re: [Tutor] Cryptography Toolkit

2005-04-01 Thread Mark Thomas
On Apr 1, 2005 6:45 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > It works if you make a new XOR object for the decryption: > > from Crypto.Cipher import XOR > > obj_xor = XOR.new("string") > str_encrypt = "encrypt this string" > print str_encrypt > > xored = obj_xor.encrypt(str_encrypt) > print

RE: [Tutor] A Newbie Printing Question

2005-04-01 Thread Christian Wyglendowski
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > > Quoting "Jacob S." <[EMAIL PROTECTED]>: > > > Cool! Does anybody know of... I guess a rather *thorough* > tutorial of > > win32? for the very reason that I don't know that this

Re: [Tutor] What is the best book to start?

2005-04-01 Thread Mike Hansen
Subject: Re: [Tutor] What is the best book to start? From: "Alan Gauld" <[EMAIL PROTECTED]> Date: Fri, 1 Apr 2005 09:05:16 +0100 To: "Hoffmann" <[EMAIL PROTECTED]>, To: "Hoffmann" <[EMAIL PROTECTED]>, I am starting to study

Re: [Tutor] Cryptography Toolkit

2005-04-01 Thread Kent Johnson
It works if you make a new XOR object for the decryption: from Crypto.Cipher import XOR obj_xor = XOR.new("string") str_encrypt = "encrypt this string" print str_encrypt xored = obj_xor.encrypt(str_encrypt) print xored obj_xor = XOR.new("string") print obj_xor.decrypt(xored) Kent Mark Thomas wrote:

Re: [Tutor] Sorting more than one list

2005-04-01 Thread Kent Johnson
Max Noel wrote: On Apr 1, 2005, at 09:59, Alan Gauld wrote: Since the data are obviously related (since you need to keep them linked), I'd be inclined to merge the lists into a list of tuples merged = [(a,b,c,d) for a in l1 for b in l2 for c in l3 for d in l4] Then you can sort 'merged' and it shou

Re: [Tutor] wxPython / Tkinter Grid

2005-04-01 Thread Michael Lange
On Fri, 1 Apr 2005 09:11:20 +0100 "Alan Gauld" <[EMAIL PROTECTED]> wrote: > > I know a wxPython grid is totally different to a Tkinter grid, but > is > > there a Tkinter equivalent of a wxPython grid? I'm finding wxPython > to > > be fiddly and restrictive... > > Then Tkinter will be more so. Tk

Re: [Tutor] function loading a file's lines to a list

2005-04-01 Thread Adriano Varoli Piazza
Il giorno ven, 01-04-2005 alle 12:46 +0200, Ewald Ertl ha scritto: > Hi! > > on Fri, 01 Apr 2005 12:01:02 +0200 Adriano Varoli Piazza <[EMAIL PROTECTED]> > wrote : > - > > Adriano Varoli Piazza > > Adri

Re: [Tutor] function loading a file's lines to a list

2005-04-01 Thread Ewald Ertl
Hi! on Fri, 01 Apr 2005 12:01:02 +0200 Adriano Varoli Piazza <[EMAIL PROTECTED]> wrote : - Adriano Varoli Piazza > Adriano Varoli Piazza > def loadfromfile(fname): Adriano Varoli Piazza > try: Adria

Re: [Tutor] function loading a file's lines to a list

2005-04-01 Thread Adriano Varoli Piazza
Il giorno ven, 01-04-2005 alle 12:01 +0200, Adriano Varoli Piazza ha scritto: [... Massive lines of code ...] It's possibly of interest that I'm running this with python 2.4.1 compiled from source on Fedora Core 3. Thanks for the patience -- Adriano Varoli Piazza The Inside Out: http://moranar.c

[Tutor] function loading a file's lines to a list

2005-04-01 Thread Adriano Varoli Piazza
I'm working on this coding assignment I had for a c++ class. For fun, I decided to implement it in Python, and I'm done. Still, I found a behaviour I can't explain: The function loadfromfile def loadfromfile(lines, fname): try: finput = file(fname, 'r') lines = [] for l

Re: [Tutor] I am puzzled - help needed

2005-04-01 Thread Alan Gauld
> from time import * > > n = time() > s = str(n) > numb = s[-2:] # last two characters of the string > numb = int(numb) # convert back to a number > guess = (raw_input('Enter a number: ')) You need to convert the string returned by raw_input() into a number guess = int(raw_input('Enter a number

Re: [Tutor] updating Oracle tables via python

2005-04-01 Thread ralf.steckel
Hi all, 1) this are the *correct* quotation marks: strUpdate = " UPDATE table SET firstname = 'JOSEPH' WHERE lastname = 'SMITH' " because SQL uses single quotation marks for character strings in column values. Double quotation marks are used to quote a column name when the column name is define

Re: [Tutor] wxPython / Tkinter Grid

2005-04-01 Thread Alan Gauld
> I know a wxPython grid is totally different to a Tkinter grid, but is > there a Tkinter equivalent of a wxPython grid? I'm finding wxPython to > be fiddly and restrictive... Then Tkinter will be more so. Tk is a fairly basic toolkit, fine for wrapping a command line app in a glossy front end but

Re: [Tutor] What is the best book to start?

2005-04-01 Thread Alan Gauld
> I really think alan gauld books, learning how to program is one of the > best esp if you are new. Thanks for the kind words! :-) However if the OP has some C - my book will likely be too basic, it starts from ground zero, but anyone who has used C will find the pace too slow I suspect. OTOH T

Re: [Tutor] What is the best book to start?

2005-04-01 Thread Alan Gauld
> I am starting to studying Python. I have some previous > experience with C (beginner level). Probably the standard tutorial on the web site is the best place for you to start. > "Learning Python" by Lutz & Ascher, And this is very good supporting material. > "Python How to Program" by Deitel

Re: [Tutor] Sorting more than one list

2005-04-01 Thread Max Noel
On Apr 1, 2005, at 09:59, Alan Gauld wrote: Since the data are obviously related (since you need to keep them linked), I'd be inclined to merge the lists into a list of tuples merged = [(a,b,c,d) for a in l1 for b in l2 for c in l3 for d in l4] Then you can sort 'merged' and it should just work

Re: [Tutor] Sorting more than one list

2005-04-01 Thread Alan Gauld
> I need to sort 4 lists but I need that they make the "sort together". > I'll sort just one but when I change the position of the items of the > 1st list I have to change the positions of the other 3 lists. Can I do > this just using the sort() method of the list object? > If I can't, someone know