Skip to content
Snippets Groups Projects
Commit 2c93c8d1 authored by marc's avatar marc
Browse files

Upgraded the script with command line argument modules

parent 8a246398
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import sys
import argparse
# Python programming course
# Author: Marc van Driel
......@@ -31,7 +31,14 @@ def calc_gc_perc(seq):
return 0.0
if __name__ == '__main__':
inpseq = sys.argv[1]
# Create our argument parser object.
parser = argparse.ArgumentParser()
# Add the expected argument.
parser.add_argument('input_seq', type=str,
help="Input sequence")
# Do the actual parsing.
args = parser.parse_args()
# And show the output.
print "The sequence '{}' has %GC of {:.2f}".format(
inpseq, calc_gc_perc(inpseq))
args.input_seq,
calc_gc_percent(args.input_seq))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment