I'm new to python, and am embarrassed to ask this python question, since it's so trivial. But I've been trawling through a mass of online tutorials , and they all seem to focus on different things
I have the following python script, called setSound.py
- Code: Select all
print 'Sound volume is being set to', str(sys.argv)
m = alsaaudio.Mixer() # defined alsaaudio.Mixer to change volume
m.setvolume( ARG1 ) # set volume
vol = m.getvolume() # get volume float value
All I need to do is pass the value ARG1 to the script as a command line argument, i.e., I want to be able to type setSound.py 50 and have it replace ARG1 by 50.
If anybody could explain, I'd be most grateful.