Archived:How to connect device to Wifi in PySymbian
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
Article Metadata
import sys, socket, urllib
apid = None
#this next line brings up the access point menu
apid = socket.select_access_point()
if not apid:
sys.exit()
apo = socket.access_point(apid)
socket.set_default_access_point(apo)
apo.start()
try:
ip = apo.ip()
print u"Connected to WiFi as %s" % ip
except:
print u"Failed to connect to WiFi"
#Then you can use urllib as much as you want without the phone bugging you to pick an access point:
url = "YOUR URL HERE"
web = urllib.urlopen(url)
response = web.read()
print response


(no comments yet)