[Tutor] Stupid newbie question
grouch at gmail.com
Sat Sep 24 18:09:36 CEST 2005
As long as you are using IDLE, why not let it handle indentation for you?
This could very well be a dumb question, and if it is, well, excuse me :)
On 9/23/05, Valone, Toren W. <TValone at dmv.ca.gov> wrote:
> I am trying to noodle thru classes with python and I built the following
> import time
> class startremail:
> def __init__(self):
> remailfile = open('U:\Bounce20.txt', 'r') #future
> address/file from outlook
> resendfile = open('resend.txt', 'w') #currently these
> files are in Python24
> EmailReport = open('erprt.txt', 'w') #Report of bad
> emails etc
> fromaddr='Tvalone at dmv.ca.gov' #set fromadd to a
> null_recepient_count = 0
> date_received = ""
> date_email_generated = ""
> Error_050 = ""
> Error_501 = ""
> Current_Date = time.ctime(time.time())
> month = Current_Date[4:8]
> day = Current_Date[8:10]
> print month
> def getday(self):
> return self.day
> def Read(self,line):
> line = remailfile.readline() #primer read
> return line
> I fire up IDLE and then do this
> from startremail import *
> x = startremail()
> print x.getday()
> I get the following return
> NameError: name 'getday' is not defined
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor