diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-05-06 06:45:51 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-05-06 06:45:51 +0000 |
commit | 1ba46c8ffe254d6e9fce6b05b7dfdd05b00514e0 (patch) | |
tree | a3a7b6d177892474e917447775db7c91c0f96bc4 /wk6/pset/dna/dna.py | |
parent | c8b1953823dc5630fc5fabe96264adb472ea6f63 (diff) |
Sun, May 5, 2024, 11:45 PM -07:00
Diffstat (limited to 'wk6/pset/dna/dna.py')
-rw-r--r-- | wk6/pset/dna/dna.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/wk6/pset/dna/dna.py b/wk6/pset/dna/dna.py index a7d0295..cde7aef 100644 --- a/wk6/pset/dna/dna.py +++ b/wk6/pset/dna/dna.py @@ -5,28 +5,28 @@ import sys def main(): # TODO: Check for command-line usage - if len(sys.argv) != 1 and len(sys.argv) != 2: + if len(sys.argv) < 2 and len(sys.argv) > 3: print("Oopsie you used the wrong number of arguments D: you should use two next time :3") return - # check to see if arg 0 is a csv file - if not sys.argv[0].endswith('.csv'): - print("Oh no, that isn't a csv file :( that won't work can you fix that please?") - return - # check to see if arg 1 is a txt file - if not sys.argv[1].endswith('.txt'): - print("Oh no, that isn't a txt file :( that won't work can you fix that please?") - return + # # check to see if arg 0 is a csv file + # if not sys.argv[0].endswith('.csv'): + # print("Oh no, that isn't a csv file :( that won't work can you fix that please?") + # return + # # check to see if arg 1 is a txt file + # if not sys.argv[1].endswith('.txt'): + # print("Oh no, that isn't a txt file :( that won't work can you fix that please?") + # return # TODO: Read database file into a variable rows = [] - with open(argv[0]) as file: + with open(sys.argv[0]) as file: reader = csv.DictReader(file) for row in reader: rows.append(row) # TODO: Read DNA sequence file into a variable sequence = '' - with open(argv[1]) as file: + with open(sys.argv[1]) as file: sequence = sequence.join(file.readlines()) # TODO: Find longest match of each STR in DNA sequence |