I can't quite put this all together... At the beginning of my script I have some user input to get basic information:
def get_provider():
print("Operations are ... ", conversion_type )
conversion = input('Enter conversion ')
This (and a few other user input sections) are what drive the rest of the script.
I would like to be able to just pass in the variables, and use argv to set the variables, rather that use the user input section. That is more for debugging purposes. I do not want to do-away with the user input section though. Just skip if args are passed in.
I think the solution revolves around argv parse and if __name__ == "__main__": ...
, but as I said, I can't quite put it all together.
Here is an example of something I tried, which didn't quite work:
def get_provider():
print("Operations are ... ", conversion_types )
conversion_type = input('Enter conversion ')
conversion_type = get_provider()
def main():
conversion_type = sys.argv[0]
if __name__ == '__main__':
main()
... the rest of the script...