Skip to content

Commit 4493ea3

Browse files
author
Ishaq Khan
committed
finished request mod
1 parent 3d6c9b7 commit 4493ea3

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

Diff for: mockData/installationInfo.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
py -m pip install -U <module>

Diff for: project/googleMaps.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! python3
12
import webbrowser, sys, pyperclip
23
sys.argv #arguments
34

@@ -7,7 +8,7 @@
78
address = ''.join(sys.argv[1:])
89
else:
910
address = pyperclip.paste()
10-
url = 'https://www.google.com/maps/place' + address
11+
url = 'https://www.google.com/maps/place/' + address
1112
webbrowser.open(url)
1213

1314

Diff for: theRequestMod.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import requests, os
2+
jekyll = 'https://www.gutenberg.org/files/42/42.txt'
3+
res = requests.get(jekyll) #contains the response
4+
res.status_code #200 means everything is okay
5+
res.text #whole copy of text
6+
7+
print(res.text[:500])
8+
os.chdir('C:\\Users\\ikhan\\Documents\\learningPython\\mockData')
9+
try:
10+
res.raise_for_status()
11+
playFile = open('drJandH.txt' , 'wb')
12+
for chunk in res.iter_content(100000):
13+
playFile.write(chunk)
14+
playFile.close()
15+
except:
16+
print('Invalid')

0 commit comments

Comments
 (0)