
![]() | Open files:
ifile = open( infilename, 'r') # r for reading ofile = open(outfilename, 'w') # w for writing afile = open(appfilename, 'a') # a for appending |
![]() | Read line by line:
for line in ifile:
# process line
|
![]() | Observe: blocks are indented; no braces! |