Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"stock.csv"
- fx = open(dest_url, "w")
- for line in lines:
- fx.write(line + "n")
- fx.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement