For processing strings, look at the "re" (regular expressions) module,
to open a file:
x = open('/file/path', 'r')
to read a file and create a list of its Lines:
x = x.readlines()
to copy that text into a new file:
y = open('/path/to/newfile', 'w')
y.writelines(x)
y.flush()
y.close()
x.close()
|