PDA

View Full Version : Help with HTML in Python


sithlord
2007-01-01, 17:29
Hi!

I want to open a url from the xbox via a python script. I'd like to have a command button or something that I can click on in order to activate the link. Basically, what I am doing is issueing a command to a storage server that I have to turn it off.

I am VERY new to python, but not to programming.

Any help would be greatly appreciated.

Here's what I have so far, which doesn't work! :shocked: Please correct me if my syntax is incorrect. The login and password and IP have been changed for demonstration purposes.:grin:


import urllib2
reg = urllib2.urlopen(url='http://login:password@192.168.1.X/exec_raw.php?cmd=reboot%20-p%20now')

try:
handle = urllib2.urlopen(req)


SL

XBLgamertag
2007-01-04, 18:29
I'm no expert but I think you have a typo...
change
handle = urllib2.urlopen(req)
to
handle = urllib2.urlopen(reg)
Let us know ;)