Skip to content

Commit 46c848e

Browse files
try 30
1 parent a8de9e2 commit 46c848e

File tree

2 files changed

+947
-0
lines changed

2 files changed

+947
-0
lines changed

30.py

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy