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

Python all any built-in function

Accept-Encoding 'gzip' to make your cralwer faster

lambda magic to find prime numbers