Help with run command + variable.
Daniel Holm
d.holmen at gmail.com
Tue Apr 14 11:15:12 EDT 2009
Hi everybody,
I'm creating my first app (SixA @ http://www.launchpad/gsixaxis) and I have
gtk.combobox to chose a profile. When a profile is chosen I save the
profiles name as a variable, and now I want to combine a command with the
variable.
Lets say that the user choses th profile firefox. This should be exactly
like running: 'sixa action profile firefox'
So the command run by my python script should be something like: 'sixa
action profile $profile'
Where $profile is the chosen profile variable.
Here is the code:
def on_profile_switch_changed(self, box):
model = box.get_model()
index = box.get_active()
if index:
profile = model[index][0]
os.system("sixa action profile $profile")
prf = pynotify.Notification ("SixA", "Profile changed to
$profile", "sixa")
prf.show ()
As you can see I also have a notifications on when the profile has been
changed, which also shows the chosen profile.
How do I do either of these?
/Daniel Holm
http://www.danielholm.se
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090414/8780a080/attachment.html>
More information about the Python-list
mailing list