import urllib.request
file = urllib. request. urlopen("http://www.example.com/a.txt")
def write_file(example): with open(file, "a")