0

Downloader script PROBLEM

I making downloader python script. Actually I dont need file to download I need to be only in RAM and in a list. Here my code, I dont whats wrong. def download(): url = "http://arka.foi.hr/~mzlatovi/zadatak.csv" link = urllib.request.urlopen(url) data = link.read() lista = [ ] for row in link: row = red.rstrip().split(";") lista.append(row) link.close() print(lista) return lista I get empty list, but if I know I can download file.

27th Apr 2017, 9:18 PM
Čajlaković Teufik
Čajlaković Teufik - avatar
2 Respostas
+ 11
Try this in your computer. I made some ajustments. But get memory limit exceeded in the playground. here is the code: https://code.sololearn.com/ch2m3E0JksYO/?ref=app
28th Apr 2017, 1:52 AM
Ulisses Cruz
Ulisses Cruz - avatar
0
Thanks for help I found that I needed data = link.read().decode().splitlines()
28th Apr 2017, 10:19 AM
Čajlaković Teufik
Čajlaković Teufik - avatar