![]() |
NeutrinorRemote...python help plz
hi, I would like to make a python script to run http:// commands like
wget -q http://192.168.2.45/control/rcem?KEY_HOME but i don't know , how can i make it, i'm not fit in python, I would like to make buttons to click. like: 1 (command: wget -q http://192.168.2.45/control/rcem?KEY_1) 2 (command: wget -q http://192.168.2.45/control/rcem?KEY_2) .. 10 (command: wget -q http://192.168.2.45/control/rcem?KEY_10) Red (command: wget -q http://192.168.2.45/control/rcem?KEY_RED) Exit (command: wget -q http://192.168.2.45/control/rcem?KEY_HOME) etc. how can i make that?? a little help start , would be nice.. |
Re: python help plz
Look into python standard library subprocess
|
Re: python help plz
Code:
import os |
Re: python help plz
If you don't want to use a subprocess to start wget, you can use the urllib2 module ( http://docs.python.org/library/ ) :
Code:
import urllib2 |
Re: python help plz
Quote:
|
Re: python help plz
Check this out:
http://www.pygtk.org/pygtk2tutorial/.../helloworld.py Add the urrlib2 code into the the def hello(...) function. Once you get the one button working, then you can copy/paste the button creation code to create the multiple buttons, and place them into a gtk.VBox (a container for your buttons). |
Re: python help plz
why dont you just use the desktop execution widget in the repos
http://talk.maemo.org/showthread.php...ktop+execution |
Re: python help plz
after some reading, ive finish my python, not nice, but my first :D
http://i42.tinypic.com/63vwh3.jpg |
Re: python help plz
Hey! congrats mate!
|
Re: python help plz
any idea to replate all ip's with only one?
like: IP = 192.168.2.45 urllib2.urlopen('http://IP/control/rcem?KEY_HOME') |
All times are GMT. The time now is 17:45. |
vBulletin® Version 3.8.8