Closed wuben2602 closed 4 years ago
Please first convert the script to a proper python program with command line options in the style of
def function_to_do_something(parameter):
...
if __name__ == '__main__':
parser = argparse.ArgumentParser....
args = ...
function_to_do_something(args.whatever)
Seems not completed yet. Let me know when it is ready for review.
I just rewrote the script to add the command line options
I wrote a few comments. I would suggest that you write a few functions to
This will make your script easier to follow.
This is my completed code as of 7/1. I adjusted the code quite a bit. The order of the columns are not the same as in the text file.
These are my most recent changes as of 7/6. I didn't really understand how to get an argument to be '-' and I just tried to the best of my ability to allow an option to be the standard input. If you could clarify, that would be greatly appreciated.
argparse doesn't accept the use of '-' as a parameter, so I had to use '-s'. If reorganize.py -s
is called, then it'll read from standard input. With both input and standard input, standard output or file output can be chosen
I meant, either
script -i -
or
script --input -
or
script -
In the first two cases, the parameters should be
add_argument('-i', '--input')
as named parameter. In the last case, the parameter should be
add_argument('input')
as positional argument.
changes as of 7/6
reorganizes text output of outbreak sim to csv file