Downloading Files from web

0 sumit bhatt · June 14, 2015
i ain't get the code form line = csv_str.split("\\n")  please some one explain? i have tried to analyse by my own code please see the code below .

>>> sam='455, pppppp,99559.kkkfma;kfm 2222, jfakfjf'
>>> rom=sam.split("\\n")
>>> rom
['455, pppppp,99559.kkkfma;kfm 2222, jfakfjf']
>>> for s in rom:
print (s)


455, pppppp,99559.kkkfma;kfm 2222, jfakfjf


here the function .split () is not dividing the string into separate lines..
what dest_url=r'goog.csv'  shows in the code (whats the use of this code where it is utilized in the code)

Post a Reply

Replies

Oldest  Newest  Rating
+1 alex constantin · June 15, 2015
You added an extra backslash, it should be:

sam.split("\n")
  • 1

Python

107,053 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator