Info: Networking: URLlib, HTTP, FTP, SSL, TCP/IP socket
Downloading files from the net using URLlib: Example (useful for simply downloading files from the net):
url = "http://weather.gov/mdl/radar/rcm1pix_b.gif" Example script : urllib_example.py
Uploading parameters and files to the net and receiving a response:
HTTP post example (useful for uploading parameters and files to the net): import httplib
params = urllib.urlencode({'data': content, 'eggs': 0, 'bacon': 0}) Example script : http_post.py Example php script : example.php For encoding descriptions and other info regarding HTTP see: www.python.org
FTP example (useful e.g. for uploading files to a URL on the net): NOTE: you need to install first the ftplib library to your phone before you can use ftp, because the Nokia Python for S60 package does not incude it by default. NOTE: You need to install the ftplib.py file on your phone as a python library (not a python script). ftp library file: ftplib.py (comes originally with the desktop python version)
from ftplib import FTP picselection = 'c:/testimg.gif' ftp = FTP('www.exampleserver.com') # connect to host
For documentation regarding FTP see: www.python.org
SSL (useful e.g. for secure connections to the net): Example script : SSL_example.py (script currently not available)
TCP/IP socket: Connect your phone to a TCP/IP socket and communicate over it: Example script for phone: tcp_socket_phone_client.py Example script for PC: tcp_socket_pc_server.py
|
|
|
|