0

Is there a quick way to copy one file's content to another one, without iterating the file line by line and writing to the other file?

hercules.cosmos
  • 265
  • 1
  • 3
  • 10

1 Answers1

-1
from subprocess import call
call(['cat', 'readfile.txt', '>>', 'writefile.txt'])
David Smith
  • 593
  • 2
  • 10
  • This tells `cat` to output the concatenation of files named `readfile.txt`, `>>`, and `writefile.txt`. `cat` doesn't process `>>` the way you're relying on; that's the shell's job. – user2357112 Oct 12 '18 at 22:02