a function and then decide inside a function what to do basing on first/second argument?
I know functions are like
def function():
blablabla
function()
and I've seen some switch examples I just need to merge it together
There is sys.argv, which is just a list of the arguments. For example, when you do ./myscript.py -t test 123 it'll be ['-t', 'test', '123'], if I remember correctly. I also recommend taking a look at argparse.
Обсуждают сегодня