#------------------------------------------------------------------------------
#  File5.py
#------------------------------------------------------------------------------
import sys


# main() ----------------------------------------------------------------------
def main():


   inputFileName = sys.argv[1]       # what if there is no 1st command line arg?
   outputFileName = sys.argv[2]      # what if there is no 2nd command line arg?
   fin = open(inputFileName)         # what if this file does not exist?
   fout = open(outputFileName, 'w')  # not much can go wrong here
   
   
   """  
   try:
      inputFileName = sys.argv[1]
   except IndexError:
      print('must place input file name on command line')
      print('Usage: python', sys.argv[0], 'input_file_name output_file_name')
      exit()
   # end try-except

   try:
      outputFileName = sys.argv[2]
   except IndexError:
      print('must place output file name on command line')
      print('Usage: python', sys.argv[0], 'input_file_name output_file_name')
      exit()
   # end try-except

   try:
      fin = open(inputFileName)
   except FileNotFoundError as e:
      print(e)
      print('Usage: python', sys.argv[0], 'input_file_name output_file_name')
      exit()
   # end try-except

   fout = open(outputFileName, 'w')
   """

   content = fin.read()
   fout.write(content)

   fin.close()
   fout.close()

# end main() ------------------------------------------------------------------

# -----------------------------------------------------------------------------
if __name__=='__main__':

    main()

# end if ----------------------------------------------------------------------