file()

2008-07-18 Thread Dylan Wilson
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

Re: pop line from file

2006-02-15 Thread Dylan Wilson
Try open.readline() >>>help(open) ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Newline at EOF Removal

2006-01-09 Thread Dylan Wilson
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

compound strip() string problem

2005-04-08 Thread Dylan Wilson
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