So I'm trying to get my program to do take the command line arguments and use it in my script. I read argparse
and the optparse
documentation and I'm still lost.
What I'm trying to do is have my code execute this on the command line:
./program <-p port> <-s> [required1] [required2]
The -p is optional, and I want to make the port a variable in my script, like so:
server_address = ('some server name', **port**)
I thought that that's what store
and dest
would do... as in store
would take the port
argument and dest
would be the variable name and I could call it like program.port
. It doesn't work this way, however, and I can't find or decipher explanations for what exactly store and dest do.
I'm new to Python, so this might not be a well-formed question.