Permalink
Browse files

turned script into 1 line (plus imports and argv parsing)

  • Loading branch information...
mwarkentin committed Jan 9, 2011
1 parent f4f364f commit 466849b9c366118566e6b014d89f2e264b0df66d
Showing with 1 addition and 8 deletions.
  1. +1 −8 ex17.py
View
@@ -3,11 +3,4 @@
script, from_file, to_file = argv
print "Copying from %s to %s" % (from_file, to_file)
# we could do these two on one line too, how?
input = open(from_file)
indata = input.read()
output = open(to_file, 'w')
output.write(indata)
open(to_file, 'w').write(open(from_file).read())

1 comment on commit 466849b

@r-choudhary

This comment has been minimized.

Show comment
Hide comment
@r-choudhary

r-choudhary Jul 30, 2016

Can you please explain the 6th line in an elaborate manner?

r-choudhary commented on 466849b Jul 30, 2016

Can you please explain the 6th line in an elaborate manner?

Please sign in to comment.