Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

yesss #1

wants to merge 2 commits into from

Conversation

Gnarflord
Copy link

pls no looky at API key

Copy link
Member

@fussel178 fussel178 left a 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. ;)

weather/weather.py Outdated Show resolved Hide resolved
owm = pyowm.OWM(API_key, language='de')

owm.is_API_online()
observation = owm.weather_at_place("Gerbrunn,de")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import os
import os
import sys
default_place = "Gerbrunn,de"

see suggestion below

@fussel178 fussel178 added the new-script A new script is incoming label Jun 21, 2020
Co-authored-by: Ludwig Richter <richter@fliegwerk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-script A new script is incoming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants