Updated args for open_files.py

This commit is contained in:
Chapin Bryce 2019-11-03 07:41:29 -05:00
parent 82f406508b
commit 18cc3c4376
1 changed files with 13 additions and 2 deletions

View File

@ -30,6 +30,7 @@ Docstring References
""" """
from io import open from io import open
import os
""" """
Copyright 2019 Chapin Bryce Copyright 2019 Chapin Bryce
@ -58,7 +59,7 @@ DEALINGS IN THE SOFTWARE.
__author__ = 'Chapin Bryce' __author__ = 'Chapin Bryce'
__date__ = 20191103 __date__ = 20191103
__license__ = 'MIT Copyright 2019 Chapin Bryce' __license__ = 'MIT Copyright 2019 Chapin Bryce'
__desc__ = '''Sample script to write to CSV files.''' __desc__ = '''Sample script to read encoded text files.'''
__docs__ = [ __docs__ = [
'https://docs.python.org/3/library/csv.html', 'https://docs.python.org/3/library/csv.html',
'https://docs.python.org/3/library/os.html' 'https://docs.python.org/3/library/os.html'
@ -86,4 +87,14 @@ def open_file(input_file):
print(line) print(line)
open_file('list_test.csv') if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description=__desc__,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
epilog=f"Built by {__author__}, v.{__date__}"
)
parser.add_argument('INPUT_FILE', help="Text file to read")
args = parser.parse_args()
open_file(args.INPUT_FILE)