Advertisement
msoo248

Untitled

Dec 9th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import sys
  2. import Zadania_1_2
  3.  
  4. def parser(input_file, output_file, insep = ',', outsep=','):):
  5.     #wyjatki obslużone w module Zadania_1_2
  6.     readed_file = Zadania_1_2.read_file(input_file, insep)
  7.     Zadania_1_2.save_file(readed_file, output_file, outsep)
  8.  
  9.  
  10. def main():
  11.     try:
  12.         path = sys.argv[1:]
  13.         assert len(sys.argv) <=2, "Input file names"
  14.         if len(sys.argv) <=3:
  15.             path = list(sys.argv[1:3])
  16.         else:
  17.             path = list(sys.argv[1:5])
  18.     except AssertionError as err:
  19.         print(err)
  20.     finally:
  21.         parser(path)
  22.         print('Program closed.')
  23.    
  24. if __name__ == '__main__':
  25.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement