Hi,
[EMAIL PROTECTED] wrote:
How should I: Open a Text file, read from it, modify it, print to another .txt?
For instance: Read a string, sort it, write the sorted string.
What do you mean by "sorting"? If you want to sort the lines contained in a file, you could do something like this.
$ cat in.txt
foo
bar
baz
ham
spam
$ cat process.py
#!/usr/bin/env python
lines = open("in.txt").readlines()
lines.sort()
out = open("out.txt", "w")
for line in lines:
out.write(line)
out.close()
$ python process.py
$ cat out.txt
bar
baz
foo
ham
spamRegards G. -- http://mail.python.org/mailman/listinfo/python-list
