Re: [Tutor] python books

2009-04-13 Thread vishwajeet singh
Take a look at Useless python http://www.uselesspython.com/ On Tue, Apr 14, 2009 at 10:37 AM, sudhanshu gautam wrote: > I am new in python , so need a good books , previously read python Bible > and swaroop but not satisfied . > > > so tell me good books in pdf format those contents good problems

[Tutor] python books

2009-04-13 Thread sudhanshu gautam
I am new in python , so need a good books , previously read python Bible and swaroop but not satisfied . so tell me good books in pdf format those contents good problems also ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

Re: [Tutor] Trouble understanding modifying parent class..

2009-04-13 Thread Guillaume Chereau
On Tue, Apr 14, 2009 at 11:27 AM, Eric Dorsey wrote: > Hi tutors, I am studying classes a bit, and am having trouble with this > concept and would appreciate your help! > > > class A: >     def __init__(self, name, value=1): >     self.name = name >     self.value = value > > And now I wan

[Tutor] Trouble understanding modifying parent class..

2009-04-13 Thread Eric Dorsey
Hi tutors, I am studying classes a bit, and am having trouble with this concept and would appreciate your help! class A: def __init__(self, name, value=1): self.name = name self.value = value And now I want a subclass, one that overrides the value=1 and defaults to value=2, h

Re: [Tutor] How to write server which listens to specific port

2009-04-13 Thread ShivKumar Anand
Thanks Kent for this valuable information. My problem is I dont know how to send/receive a file using socket. How to get the filename specifically. Thanks Shiv > Date: Fri, 10 Apr 2009 06:56:34 -0400 > Subject: Re: [Tutor] How to write server which listens to specific port > From: k

[Tutor] path to executing .py file

2009-04-13 Thread tiefeng wu
Hello everybody! I'm working on my code repository (svn) auto-backup script which get hotcopy of svn repository directory to a directory named by date in same location where script file is, it executed by a timer program every 00:00 clock. Everything works fine when I'm testing by double click it.

Re: [Tutor] Trapping warnings from MySQLdb

2009-04-13 Thread Tim Johnson
On Monday 13 April 2009, Kent Johnson wrote: <> > >From a quick look at MySQLdb-1.2.2, it seems to be using the python > > std lib module warnings to report warnings. > http://docs.python.org/library/warnings.html > > >From the warnings docs, it seems like warnings.simplefilter() is what > > yo

Re: [Tutor] Trapping warnings from MySQLdb

2009-04-13 Thread Kent Johnson
On Mon, Apr 13, 2009 at 7:22 PM, Tim Johnson wrote: > FYI: Using python 2.5 with the MySQLdb module. > I need to be able to raise an exeception on a MySQL warning. > > I have used my own class for years that wraps the MySQLdb module, > but never did build in a feature that would let me 'tell' my c

Re: [Tutor] sender name in smtplib

2009-04-13 Thread Kent Johnson
On Mon, Apr 13, 2009 at 6:55 PM, George Wahid wrote: > I want to send an email from a google mail account so that the sender > name will be 'User Name' instead of 'usern...@gmail.com' in the inbox. > this is the code I use:         (I'm using python 2.5) import smtplib g=smtplib.SMTP('smtp

[Tutor] Trapping warnings from MySQLdb

2009-04-13 Thread Tim Johnson
FYI: Using python 2.5 with the MySQLdb module. I need to be able to raise an exeception on a MySQL warning. I have used my own class for years that wraps the MySQLdb module, but never did build in a feature that would let me 'tell' my class instances to raise an except for a warning: Example: I'm

Re: [Tutor] sender name in smtplib

2009-04-13 Thread David
George Wahid wrote: I want to send an email from a google mail account so that the sender name will be 'User Name' instead of 'usern...@gmail.com' in the inbox. this is the code I use: (I'm using python 2.5) import smtplib g=smtplib.SMTP('smtp.googlemail.com') g.ehlo();g.starttls();g.ehl

[Tutor] sender name in smtplib

2009-04-13 Thread George Wahid
I want to send an email from a google mail account so that the sender name will be 'User Name' instead of 'usern...@gmail.com' in the inbox. this is the code I use: (I'm using python 2.5) >>>import smtplib >>>g=smtplib.SMTP('smtp.googlemail.com') >>>g.ehlo();g.starttls();g.ehlo() >>>g.login

Re: [Tutor] OOPS Problem

2009-04-13 Thread wesley chun
hi, and welcome to Python! my comments below... > I made a class with the name student that prints simply name of the student > as well as his roll_no also, pasting code here . sounds pretty straightforward > class student: >     def __init__(self,name,roll_no): >         self.name=name >    

[Tutor] OOPS Problem

2009-04-13 Thread sudhanshu gautam
I am reading python since last 15 days ,read some basics of python , Last night was reading about the OOPS concepts ,but getting some problems , going to discuss with you people. MY CODE : I made a class with the name student that prints simply name of the student as well as his roll_no also,

Re: [Tutor] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread W W
On Mon, Apr 13, 2009 at 1:22 PM, Gregor Lingl wrote: > Wayne Watson schrieb: > >> Sometime ago, one of my posts brought a response brief exchange on event >> handling*. Where might I find more about event handling with respect to the >> keyboard, and particularly with a mouse. In the latter case,

Re: [Tutor] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread Gregor Lingl
Wayne Watson schrieb: Sometime ago, one of my posts brought a response brief exchange on event handling*. Where might I find more about event handling with respect to the keyboard, and particularly with a mouse. In the latter case, I'm interested in finding the pixel position of the mouse on

Re: [Tutor] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread Alan Gauld
"Wayne Watson" wrote about other sources. The few books I have on Python seem to avoid the subject. Perhaps it goes by another name in Python-ville. No, its just that GUI programming is, relatively, a minority interest for Python programmers and event handling is a subset of GUI programming

Re: [Tutor] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread Wayne Watson
I see between Alan's site and the NM Tech Tkinter manual, that's good coverage for what I need. Wayne Watson wrote: Sometime ago, one of my posts brought a response brief exchange on event handling*. Where might I find more about event handling with respect to the keyboard, and particularly wi

[Tutor] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread Wayne Watson
Sometime ago, one of my posts brought a response brief exchange on event handling*. Where might I find more about event handling with respect to the keyboard, and particularly with a mouse. In the latter case, I'm interested in finding the pixel position of the mouse on a canvas. * I see from

Re: [Tutor] Using numpy Array Capabilities

2009-04-13 Thread Wayne Watson
Alan Gauld wrote: "Wayne Watson" wrote Basically, what I would like to do is to take a list like: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] and convert it to; [['0x0', '0x1', '0x2', '0x3', '0x4'], ['0x5', '0x6', '0x7', '0x8', '0x9']] What is the basis of this conversion? Use of pyfits (FITS for

Re: [Tutor] How to programmatically EDIT a python file usin g an editorof my choice ?

2009-04-13 Thread Dominique
Sander Sweers gmail.com> writes: > > 2009/4/13 Dominique gmail.com>: > > What surprises me is that before calling the subprocess.Popen() method, I > > normalized the path using: > > filename = os.path.normpath(filename). > > It does.But do you also call os.path.normpath for the program path? >

Re: [Tutor] get bytes back from string representation?

2009-04-13 Thread Daniel
(also cc tutor) Thank you, Alan. I found the solution. the type of rawByte in SOAP is so I need to convert it back to ascii with binascii module, like: >>> btxt = binascii.a2b_base64(page.rawByte) then btxt can be treated as a normal string. thanks, Daniel On Mon, Apr 13, 2009 at 3:32 PM,

Re: [Tutor] Using numpy Array Capabilities

2009-04-13 Thread Alan Gauld
"Wayne Watson" wrote Basically, what I would like to do is to take a list like: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] and convert it to; [['0x0', '0x1', '0x2', '0x3', '0x4'], ['0x5', '0x6', '0x7', '0x8', '0x9']] What is the basis of this conversion? Why did you split it into two lists? Why conv

Re: [Tutor] get bytes back from string representation?

2009-04-13 Thread Alan Gauld
"Daniel" wrote Caveat, I know nothing about SUDS. rawByte = "PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb2 the problem is I need to convert the rawByte from string to bytes, then explain it as text with encoding (like "UTF-8"). A string is a collection of bytes. What y

Re: [Tutor] How to programmatically EDIT a python file using an editorof my choice ?

2009-04-13 Thread Sander Sweers
2009/4/13 Dominique : > What surprises me is that before calling the subprocess.Popen() method, I > normalized the path using: > filename = os.path.normpath(filename). It does.But do you also call os.path.normpath for the program path? See below an example. >>> import os >>> path = 'C:\Program Fi