-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yesss #1
base: master
Are you sure you want to change the base?
yesss #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall nice script, but please remove the API key from an open source project.
I think, it's your private key for personal use. ;)
owm = pyowm.OWM(API_key, language='de') | ||
|
||
owm.is_API_online() | ||
observation = owm.weather_at_place("Gerbrunn,de") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observation = owm.weather_at_place("Gerbrunn,de") | |
observation = owm.weather_at_place(sys.argv[0] if len(sys.argv) > 0 else default_place) |
You can use the process arguments to search dynamically for a place and use a fallback value for missing process arguments.
@@ -0,0 +1,22 @@ | |||
#!/usr/bin/env python | |||
import pyowm | |||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import os | |
import os | |
import sys | |
default_place = "Gerbrunn,de" |
see suggestion below
Co-authored-by: Ludwig Richter <richter@fliegwerk.com>
pls no looky at API key