Im new to Python, and Im learning it fro the new boston's guide on youtube.
im having trouble downloading csv files through python.
this is the code -
The error im receiving is-
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/untitled/New_Boston_ep_24.py", line 1, in <module>
from urllib.request import urlopen
ImportError: No module named request
PS im new to forums, so let me know if i made any mistake in posting. Help is appreciated
im having trouble downloading csv files through python.
this is the code -
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from urllib import request def download_stock_data(csv_url): response = request.urlopen(csv_url) csv = response.read() csv_str = str (csv) lines = csv_str.split( "\\n" ) dest_url = r 'goog.csv' fx = open (dest_url, "w" ) for line in lines: fx.write(line + "\n" ) fx.close() download_stock_data(goog_url) |
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/untitled/New_Boston_ep_24.py", line 1, in <module>
from urllib.request import urlopen
ImportError: No module named request
PS im new to forums, so let me know if i made any mistake in posting. Help is appreciated