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
Try open.readline()
>>>help(open)
...
--
http://mail.python.org/mailman/listinfo/python-list
Do you mean somthing like this?
>>> f = open("file.txt")
>>> w = open('outfile.txt', 'w')
>>> for line in f.split('\n'):
...w.write(line)
...
>>> w.close()
>>> '\n' in open('/home/wandleg/outfile.txt').read()
False
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm new to python and i have a string problem.
My problem is this
--
>>>import time
>>>time = time.asctime()
>>>time
'Fri Apr 08 22:14:14 2005'
>>>ti = time[0:13]
>>>me = time[14:16]
>>>time = ti + me
>>>time
'Fri Apr 08 22