Learn Python the Hard Way Exercise 17 Extra Question(S)
indata = open(from_file).read()
shutil is the way to do one-liner file copies in Python:
shutil.copy(sys.argv[1], sys.argv[2])
Putting the import shutil, sys
on the same line as this one (with a semicolon in-between, of course) would however be stylistically goofy;-).
Well you can just do "algebraic substitution," right? ...assuming you don't care about the "UI"...
open(to_file, 'w').write(open(from_file).read())