KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I write my scripts in python and run them with cmd by typing in: C:\> python script.py Some of my scripts contain separate algorithms and methods which are called based on a flag. Now I would like to pass the flag through cmd directly rather than having to go into the script and change the flag prior to run, I want something similar to: C:\> python script.py -algorithm=2 I have read that people use sys.argv for almost similar purposes however reading the manuals and forums I couldn't understand how it works.
Tags (comma-separated)
Save Edits
Cancel