Re: [Tutor] Running multiple version of Python on 1 windows machine

2006-11-01 Thread wesley chun
> try >import sqlite3 as sqlite # Python 2.5 > except ImportError: >from pysqlite2 import dbapi2 as sqlite i second kent's suggestion here. in fact, i ran into a very similar issue while working on the database chapter for the new edition of the book. i had 2.4.2 with pysqlite 2.1.3 on

[Tutor] How to capture 'Ctrl+c' in Python

2006-11-01 Thread Asrarahmed Kadri
  Hi folks, How can I know that the user has pressed a particular key or a combination of keys.. for example 'q' or 'Ctrl-c' ?   Thanks in anticipation.   Regards,   Asrarahmed     -- To HIM you shall return. ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] Running multiple version of Python on 1 windows

2006-11-01 Thread Kent Johnson
Tony Cappellini wrote: > >From Kent > >>You don't say what OS you are running but under Windows it is trivial to > >>have multiple versions of Python installed, I have 2.3, 2.4 and 2.5. > >>They are each in their own directories, all in the system path. I have > >>aliases called py23, py24 and

Re: [Tutor] Simple calculator

2006-11-01 Thread Kent Johnson
Joe Cox wrote: > I found this simple calculator on the web: > > from Tkinter import * > from math import * > ###http://sunsite.uakom.sk/sunworldonline/swol-02-1998/swol-02-python.htmlBy > Cameron Laird and Kathryn Soraiz...Getting Started with Python### > > def evaluate(event): > label['t

Re: [Tutor] Simple calculator

2006-11-01 Thread Michael Lange
Hi Joe, On Tue, 31 Oct 2006 18:37:27 -0800 "Joe Cox" <[EMAIL PROTECTED]> wrote: > I found this simple calculator on the web: > > from Tkinter import * > from math import * > ###http://sunsite.uakom.sk/sunworldonline/swol-02-1998/swol-02-python.htmlBy > Cameron Laird and Kathryn Soraiz...Getting

Re: [Tutor] How to capture 'Ctrl+c' in Python

2006-11-01 Thread Andreas Kostyrka
Am Mittwoch, den 01.11.2006, 10:14 + schrieb Asrarahmed Kadri: > > > Hi folks, > How can I know that the user has pressed a particular key or c > combination of keys.. for example 'q' or 'Ctrl-c' ? In practice that depends upon your environment. Unix/Linux, MacOS, Windows, GUI vs. cmdli

Re: [Tutor] Mapping to object attributes

2006-11-01 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld > Sent: Tuesday, October 31, 2006 4:47 PM > To: tutor@python.org > Subject: Re: [Tutor] Mapping to object attributes > > > "Mike Hansen" <[EMAIL PROTECTED]> wrote > > > I've got a web f

Re: [Tutor] immutable objects

2006-11-01 Thread Danny Yoo
> here is the stack > trace. i know that SOAPpy is doing wrong by not checking the type of > the element along with id(ele). > I thought if there is any work around the problem i could use that without > upgrading SOAPpy after it is fixed. Hi Premnath, You might want to see if some other SOAP mod

Re: [Tutor] off topic GNOME background

2006-11-01 Thread Danny Yoo
On Tue, 31 Oct 2006, Amadeo Bellotti wrote: > my background just disappeared it shows a black screen like it cant find > the default background. if that makes sense I've added my own and it > cant seem to find it i removed it and re added it it doesn't seem to be > working though anyone have

[Tutor] how to test .mov file using python

2006-11-01 Thread [EMAIL PROTECTED]
I know that python has many packages such as nose, which is for testing. Now I am going to test a quicktime file to find out if it works properly. Are there an existing python package could do that? And how to write the program? Thanks, Yi ___ Tutor mail

[Tutor] Help me with graphs...using tkinter

2006-11-01 Thread Asrarahmed Kadri
Hi folks,   I want to draw bar-charts using Tkinter. I am not able to find material on this topic.   Help me   Regards, Asrarahmed     -- To HIM you shall return. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tut

Re: [Tutor] I am terribly confused about "generators" and "iterators".. Help me

2006-11-01 Thread Kent Johnson
Kent Johnson wrote: > Bob Gailer wrote: >> Asrarahmed Kadri wrote: >>> >>> What are generators and iterators...??And why are they are needed..?? >>> >>> I can do my stuff with a 'for' or a 'while' loop.. so why do I need an >>> ITERATOR..? >> iterators & generators do not replace while or for

Re: [Tutor] immutable objects

2006-11-01 Thread Premnath Sah
 On 11/1/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > here is the stack> trace. i know that SOAPpy is doing wrong by not checking the type of> the element along with id(ele).> I thought if there is any work around the problem i could use that without > upgrading SOAPpy after it is fixed.Hi Premnath,Y

Re: [Tutor] how to test .mov file using python

2006-11-01 Thread Andreas Kostyrka
Am Mittwoch, den 01.11.2006, 10:39 -0500 schrieb [EMAIL PROTECTED]: > I know that python has many packages such as nose, which is for > testing. Now I am going to test a quicktime file to find out if it > works properly. Are there an existing python package could do that? > And how to write the pro

Re: [Tutor] Help me with graphs...using tkinter

2006-11-01 Thread Michael Lange
Hi Asrarahmed, On Wed, 1 Nov 2006 16:16:31 + "Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote: > Hi folks, > > I want to draw bar-charts using Tkinter. I am not able to find material on > this topic. > have a look at the Canvas widget and especially at its create_rectangle() method. Document

Re: [Tutor] How to capture 'Ctrl+c' in Python

2006-11-01 Thread Chris Hengge
Do you by chance know of a way to capture special keys like "Print Screen"?I have a small script to grab all they keycodes, but it doesn't seem to catch several keys on the keyboard. I've got a utility that I'd like to be able to automagically get a screenshot when something goes wrong so I dont ha

Re: [Tutor] how to test .mov file using python

2006-11-01 Thread [EMAIL PROTECTED]
Andreas, Thank you very much for your reply. "Using mplayer to test if the video track decodes" sounds like a good idea. I am a new python user. Could you please talk more details about how to do that. Thanks again, YiOn 11/1/06, Andreas Kostyrka <[EMAIL PROTECTED]> wrote: Am Mittwoch, den 01.11.

[Tutor] Writing Classes in python

2006-11-01 Thread Rajesh R
I am new to Python and i have a very basic question about writing classes. Lets say i have the following code : class Sample: 'A simple class' def method1(): print 'Inside Method1' When i create an instance of the class and when i try to call the method method1, i get an error message.

Re: [Tutor] how to test .mov file using python

2006-11-01 Thread Hugo Gonzalez M
[EMAIL PROTECTED] wrote: > Andreas, > Thank you very much for your reply. "Using mplayer to test if the video > track decodes" sounds like a good idea. I am a new python user. Could > you please talk more details about how to do that. Hi, mplayer is a separate program and has nothing to do with

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Kent Johnson
Rajesh R wrote: > I am new to Python and i have a very basic question about writing classes. > Lets say i have the following code : > > class Sample: > 'A simple class' > > def method1(): >print 'Inside Method1' > > When i create an instance of the class and when i try to call the metho

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Danny Yoo
On Wed, 1 Nov 2006, Rajesh R wrote: > I am new to Python and i have a very basic question about writing > classes. Lets say i have the following code : > [code cut] Hi Rajesh, Take a look at a Python class tutorial: http://www.diveintopython.org/object_oriented_framework/defining_classes.htm

Re: [Tutor] how to test .mov file using python

2006-11-01 Thread Andreas Kostyrka
Am Mittwoch, den 01.11.2006, 15:57 -0500 schrieb [EMAIL PROTECTED]: > Andreas, > Thank you very much for your reply. "Using mplayer to test if the Well, that's nothing python related. mplayer is an Linux movie player that can be used for all kinds of secondary uses. Andreas > video track decodes"

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Andreas Kostyrka
class Sample: def method1(self): print "method1" s = Sample() s.method1() Please notice, you need () to invoke a method in Python, and you need an explicit self argument on the method definition. Andreas Am Mittwoch, den 01.11.2006, 21:21 + schrieb Rajesh R: > I am new to Python

Re: [Tutor] Writing Classes in python

2006-11-01 Thread Rajesh R
Thanks All, It worked. Rajesh >From: Andreas Kostyrka <[EMAIL PROTECTED]> >To: Rajesh R <[EMAIL PROTECTED]> >CC: Tutor@python.org >Subject: Re: [Tutor] Writing Classes in python >Date: Wed, 01 Nov 2006 22:39:57 +0100 > >class Sample: > def method1(self): > print "method1" > >s = Sampl

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Dick Moores
At 12:14 AM 10/31/2006, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > I'd like to know how to use sys.exit() to quit a program. > > > >I see that you already figured that out. >You can also quit by raising SystemExit, which is >what sys.exit does... but you don't need to import sy

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Andreas Kostyrka
Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: > At 12:14 AM 10/31/2006, Alan Gauld wrote: > > >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > I'd like to know how to use sys.exit() to quit a program. > > > > > > >I see that you already figured that out. > >You can also quit by raisi

[Tutor] str.strip() help

2006-11-01 Thread Chris Hengge
I can't figure out a way to .strip("string")Example might look like this:>>> myStr = "I want to strip my words.">>> print myStr.strip("my")>>> 'I want to strip words.' Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

Re: [Tutor] str.strip() help

2006-11-01 Thread John Fouhy
On 02/11/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > I can't figure out a way to .strip("string") > > Example might look like this: > > >>> myStr = "I want to strip my words." > >>> print myStr.strip("my") > >>> 'I want to strip words.' .strip() only removes text from the beginning and end of th

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Dick Moores
At 03:56 PM 11/1/2006, Andreas Kostyrka wrote: >Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: > > At 12:14 AM 10/31/2006, Alan Gauld wrote: > > > > >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > > I'd like to know how to use sys.exit() to quit a program. > > > > > > > > > >I see tha

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Dick Moores
At 10:16 PM 11/1/2006, Dick Moores wrote: >BTW at the command line, "raise SystemExit(2)" produces a completely >silent exit. In Win IDE I get "SystemExit: 2". With IDLE: > >Traceback (most recent call last): >File "E:\Python25\dev\1unitConversion5a.py", line 425, in > main() >File "E

Re: [Tutor] Using sys.exit()

2006-11-01 Thread Luke Paireepinart
Dick Moores wrote: > At 03:56 PM 11/1/2006, Andreas Kostyrka wrote: > >> Am Mittwoch, den 01.11.2006, 15:43 -0800 schrieb Dick Moores: >> >>> At 12:14 AM 10/31/2006, Alan Gauld wrote: >>> >>> "Dick Moores" <[EMAIL PROTECTED]> wrote > I'd like to know how to use