Skip to content

Latest commit

 

History

History
112 lines (80 loc) · 2.37 KB

File metadata and controls

112 lines (80 loc) · 2.37 KB

Quick Start Guide

Folder Structure

python-venv-tutorial/
├── README.md                  # Main tutorial content
├── GITHUB_SETUP.md            # Instructions for uploading to GitHub
├── requirements.txt           # Example dependencies file
├── .gitignore                 # Git ignore file
└── examples/                  # Example scripts
    ├── hello_world.py         # Basic script example
    ├── fetch_data.py          # Package usage example
    └── dependencies.py        # Environment info example

Quick Start

1. Create Virtual Environment

# Windows
python -m venv venv
venv\Scripts\activate

# macOS/Linux
python3 -m venv venv
source venv/bin/activate

2. Try the Examples

# Run the first example
python examples/hello_world.py

# Run the environment info example
python examples/dependencies.py

# Install requests and run the second example
pip install requests
python examples/fetch_data.py

3. Check What's Installed

pip list
pip freeze

4. Deactivate When Done

deactivate

File Descriptions

README.md

Complete tutorial covering:

  • What virtual environments are
  • How to create and activate them
  • Installing and managing packages
  • Best practices
  • Troubleshooting

examples/

Three example Python scripts:

  • hello_world.py: Simple greeting script
  • fetch_data.py: Shows how to use external packages
  • dependencies.py: Displays environment information

requirements.txt

Template file showing how to track dependencies.

.gitignore

Ensures virtual environments and cache files aren't uploaded to Git.


Next Steps

  1. Read the Tutorial: Open README.md for the full guide
  2. Follow GITHUB_SETUP.md: Instructions to upload to GitHub
  3. Run the Examples: Try each example script
  4. Create Your Own: Use this as a template for your projects

Learning Path

  1. Beginner: Read README.md intro sections
  2. Intermediate: Try all examples in the examples/ folder
  3. Advanced: Set up real projects with requirements.txt
  4. Expert: Share on GitHub and collaborate with others

Resources


Happy Learning! 🐍