file()

Dylan Wilson dylanwilson at ymail.com
Fri Jul 18 19:33:52 CEST 2008


well, I'm in the beginings of making a random sentence generator for a mod my friend makes, but I want the nouns, verbs pastverbs, etc. to be easily customizable by editing a file, but, last night file() worked fine and today it's saying " line 1: `read_who = file('who.ini', 'r')'"

here's what I have so far, but for reference it's possible I'm just being an idiot because I'm very new to Python and programming in general



read_who = file('who.ini', 'r')
who = read_who.read()

read_what = file('what.ini', 'r')
what = read_what.read()

read_end = file('end.ini', 'r')
end = read_end.read()

read_because = file('because.ini', 'r')
because = read_because.read()

read_the = file('the.ini', 'r')
da = read_the.read()

read_period = file('punc.ini', 'r')
period = read_period.read()
prd = read_period.read()

read_nouns = file('nouns.ini', 'r')
nouns = read_nouns.read()

read_verbs = file('verbs.ini', 'r')
verbs = read_verbs.read()

read_pastverbs = file('pastverbs.ini', 'r')
pastverbs = read_pastverbs.read()



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080718/6b5da1eb/attachment.html>


More information about the Python-list mailing list