[Tutor] Stupid newbie question

grouchy 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
> class
>
> 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
> constant
> 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
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050924/22e24983/attachment.html


More information about the Tutor mailing list