Skip to content

Instantly share code, notes, and snippets.

@macolyte
Last active December 11, 2015 21:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macolyte/4664384 to your computer and use it in GitHub Desktop.
Save macolyte/4664384 to your computer and use it in GitHub Desktop.
Learn something new every day with Pythonista
from datetime import date
import webbrowser
import console
def main():
result = console.alert("Today I Learned", "Choose your path", "reddit", "today", "random")
today = date.today().strftime("%B_%d")
urls = ["http://www.reddit.com/r/todayilearned", ("http://en.wikipedia.org/wiki/%s" % today), "http://en.wikipedia.org/wiki/Special:Random"]
url = urls[result-1]
webbrowser.open(url)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment