Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
John Donnal
/
comms_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dd7cd711
authored
Oct 19, 2020
by
source_reader
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
added http demo
parent
785573e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
http_client.py
http_client.py
0 → 100644
View file @
dd7cd711
import
json
import
requests
API_KEY
=
"--REDACTED--"
city_name
=
"Annapolis"
URL
=
"https://api.openweathermap.org/data/2.5/weather?q=
%
s&appid=
%
s&units=imperial"
%
(
city_name
,
API_KEY
)
r
=
requests
.
get
(
URL
)
data
=
r
.
json
()
print
(
"It is currently
%
d degrees in
%
s"
%
(
data
[
'main'
][
'temp'
],
city_name
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment