Skip to content
Snippets Groups Projects
Select Git revision
  • 99f1bc1d9ede5c85a7ebb6015102442b2e98206b
  • main default protected
2 results

spielwiese.py

Blame
  • spielwiese.py 546 B
    import requests  # Apache 2.0
    import numpy as np
    
    callbacktable = {"myFunc": "hello_world"}
    
    
    def hello_world():
        print('Hello World!')
    
    
    if __name__ == '__main__':
        globals()[callbacktable["myFunc"]]()
        response = requests.get(f"https://history.muffinlabs.com/date", headers={"Accept": "application/json"})
        result = response.json()
        print('Done')
        facts = np.random.choice(result['data']['Events'], 5)
        print('5 Random History Facts about today:')
        for fact in facts:
            print(f'In {fact["year"]}: {fact["text"]}')