Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 46c848e

Browse filesBrowse files
try 30
1 parent a8de9e2 commit 46c848e
Copy full SHA for 46c848e

File tree

2 files changed

+947
-0
lines changed
Filter options

2 files changed

+947
-0
lines changed

‎30.py

Copy file name to clipboard
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import download_file
2+
import csv
3+
4+
5+
def main():
6+
url = "http://www.pythonchallenge.com/pc/ring/yankeedoodle.csv"
7+
file_path = "relax/yankeedoodle.csv"
8+
user = "repeat"
9+
password = "switch"
10+
# first_step(url, file_path, user, password)
11+
second_step(file_path)
12+
13+
14+
def first_step(url, file_path, user, password):
15+
download_file.download_with_auth(url, file_path, user, password)
16+
17+
18+
def second_step(file_path):
19+
with open(file_path, newline="") as csvfile:
20+
spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
21+
for row in spamreader:
22+
print(" ".join(row))
23+
24+
25+
if __name__ == "__main__":
26+
main()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.