0

So I have a code that prints out the sys.argv when the program is ran. How can I parse

$ python ./arch.py install *

to show ["./arch.py","install","*"]
Instead of ["./arch.py","install",#other files in directory]?

2
Contributors
1
Reply
21
Views
5 Years
Discussion Span
Last Post by deceptikon
2

Wildcards are interpreted by the shell before your program gets a chance to touch them. If you want them passed as literals, then escape them so that they're not interpreted as wildcards:

$ python ./arch.py install \*
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.