I have a set of python code written up in file.py. Within the code is about 5-6 different functions/sections. What I want to do is execute the python code from the Command Prompt, but only execute the parts that I want to execute. For instance, from the Command Prompt, I would enter ...\file.py [-fun2,fun4] . Entering this would only run section 2 and section 4 in my code. How would I do this?
Also, expanding on this, I want to enter necessary parameters for my functions that are needed. How would I do this for both the command prompt AND the python code. For example, in my code I have num=43. I would want to go to my command prompt and enter ...\file.py [-fun2] [-num=789]. This would run section 2 and change the num value from 43 to 789. Any help would be appreciated. Thanks
Also, expanding on this, I want to enter necessary parameters for my functions that are needed. How would I do this for both the command prompt AND the python code. For example, in my code I have num=43. I would want to go to my command prompt and enter ...\file.py [-fun2] [-num=789]. This would run section 2 and change the num value from 43 to 789. Any help would be appreciated. Thanks
Comment