def read(url, n): import urllib.request file = urllib.request.urlopen(url) contents = file.readlines(n) for items in contents: print(items) When working with the Ukrainian text this result:
b'\xd0\x92\xd0\x90\xd0\x96\xd0\x9b\xd0\x98\xd0\x92\xd0\x86 \xd0\xa7\xd0\x98\xd0\xa1\xd0\x9b\xd0\x90:\t \n' How vivest Cyrillic?