Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
import shutil
shutil.copyfile('input.txt', 'output.txt')

View file

@ -0,0 +1,6 @@
infile = open('input.txt', 'r')
outfile = open('output.txt', 'w')
for line in infile:
outfile.write(line)
outfile.close()
infile.close()

View file

@ -0,0 +1,20 @@
import sys
try:
infile = open('input.txt', 'r')
except IOError:
print >> sys.stderr, "Unable to open input.txt for input"
sys.exit(1)
try:
outfile = open('output.txt', 'w')
except IOError:
print >> sys.stderr, "Unable to open output.txt for output"
sys.exit(1)
try: # for finally
try: # for I/O
for line in infile:
outfile.write(line)
except IOError, e:
print >> sys.stderr, "Some I/O Error occurred (reading from input.txt or writing to output.txt)"
finally:
infile.close()
outfile.close()

View file

@ -0,0 +1,9 @@
import sys
try:
with open('input.txt') as infile:
with open('output.txt', 'w') as outfile:
for line in infile:
outfile.write(line)
except IOError:
print >> sys.stderr, "Some I/O Error occurred"
sys.exit(1)