I have a python script where I need to pass multiple arguments. The first argument may have multiple emails, second is a string and the third is a string too.
Lets say I have the file
mytest.py:
def tfunc(em, st1, st2):
#### do blah blah blah
def main ():
eml = sys,argv[1].strip()
st1v = sys,argv[2].strip()
st2v = sys,argv[3].strip()
dosom = tfunc(eml, st1v, st2v)
if __name__ == '__main__':
main()
Now the way I am testing to run the function on command line is :
python mytest.py xx@yz.com value of file 1 value of file 2
So the arguments are actually xx@yz.com ( also need to know what will happen if I have multiple emails), "value of file 1" and "value of file 2"
In my actual final code the spaces will be there for both the arguments. However when I run the code it takes the email ( if only one) correctly, but takes the 2nd argument as value ( from the first argument) and of (from the first argument). But that's not what I want.
I am looking for the xx@yz.com as first argument, "value of file 1" as 2nd argument and "value of file 2" as third argument.
Can I get some help. Thanks in advance.