[Tutor] Stupid newbie question
Valone, Toren W.
TValone at DMV.CA.gov
Sat Sep 24 00:27:38 CEST 2005
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
More information about the Tutor
mailing list