Reputation: 75555
Consider the following string:
./kmux.py -r 'messenger.* xx'
If kmux.py
is a python script, and the string above was given to bash as an argument, then sys.argv
will be the following list:
["./kmux.py", "-r", "messenger.* xx"]
Is there a standard python function that will take the first string and turn it into the array?
I could manually replicate bash's logic in Python to take the original string and turn it into this array, but I am curious about whether such a function already exists.
Upvotes: 2
Views: 122