Real Python
  • Start Here
  • Learn Python
    Python Tutorials →
    In-depth articles and video courses
    Learning Paths →
    Guided study plans for accelerated learning
    Quizzes & Exercises →
    Check your learning progress
    Browse Topics →
    Focus on a specific area or skill level
    Community Chat →
    Learn with other Pythonistas
    Office Hours →
    Live Q&A calls with Python experts
    Podcast →
    Hear what’s new in the world of Python
    Books →
    Round out your knowledge and learn offline
    Reference →
    Concise definitions for common Python terms
    Code Mentor →Beta
    Personalized code assistance & learning tools
    Unlock All Content →
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Tutorial Writer Become a Video Instructor
  • Search
/
  • Join
  • Sign‑In

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.

Browse Topics Guided Learning Paths
Basics Intermediate Advanced
ai algorithms api best-practices career community databases data-science data-structures data-viz devops django docker editors flask front-end gamedev gui machine-learning news numpy projects python stdlib testing tools web-dev web-scraping

Table of Contents

  • Demo
  • Project Overview
  • Prerequisites
  • Step 1: Get Access to a Suitable Weather API
    • Get an OpenWeather API Key
    • Make an API Request and Inspect the Data
  • Step 2: Handle Secrets in Your Code
    • Create Your Project Folder Structure
    • Protect Your API Key
    • Access Your API Key in Your Python Code
  • Step 3: Create a CLI for Your Python Weather App
    • Set Up an Argument Parser
    • Parse Input Arguments
  • Step 4: Get the Weather Information
    • Build the URL
    • Make an HTTP Request With Python
    • Handle Exceptions in Your Code
  • Step 5: Display the Output of Your Python Weather App
    • Identify the Relevant Data
    • Build a Display Function
    • Add String Padding to Your Output
  • Step 6: Style the Weather App’s Output
    • Change Terminal Output Colors
    • Format Weather Types in Different Colors
    • Refactor Your Code and Add Emojis
  • Conclusion
  • Next Steps