×
Namespaces

Variants
Actions

Archived:How to connect device to Wifi in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: 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.

Article Metadata
Article
Created: User:Kandyfloss (23 Mar 2008)
Last edited: hamishwillee (31 May 2013)
This article contains code to connect to Wifi using PySymbian.
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
This page was last modified on 31 May 2013, at 04:08.
60 page views in the last 30 days.