PyS60 - download file using urlretrieve

The following function written in Python downloads a remote file to mobile phone.

import urllib

def download_file():
remoteFileName = u"http://example.com/a.txt" # set the url here
localFileName = u"c:\\items.txt"
urllib.urlretrieve(remoteFileName, localFileName)

download_file()

The code was used in my 'DSE Price Tracker' application in order to download the list of companies.

Comments

Popular posts from this blog

Strip HTML tags using Python

lambda magic to find prime numbers

Convert text to ASCII and ASCII to text - Python code