Possible Duplicate:
Python argparse and bash completion
In a bash prompt (like on a Ubuntu system) if you type service
and then tab a few times you would get a list of all the services available.
Is there a way to do the same with a python script? So if you had a script called music that looked like this:
def dumbstuff():
#plays pop music...
def rockingstuff():
#Plays music that will scare your mother...
And on the command line you type music
with a few tabs I would like to see outputted:
dumbstuff
rockingstuff
Is there a way to do this?