Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
mdzaifPublic archive

About

Python Practice codes are stored here

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Get Started

  1. Clone this repository.

  2. Navigate this repository.

cd Python_Practice

Setup with uv (New package and project manager for Python)

First, why uv? when you run a single python script and you need only specific packages are need to run this script not all of your scripts need those modules or packages. Then, uv here to save your time and package management. It also helpful in project management. Comparatively, it is way faster than pip command. A great feature of uv is that, it not requires virtual environment for script files. Moreover, it automatically creates virtualenv for your python project.

pip3 install uv

windows:

pip install uv

For newer file which not include those lines:

# /// script
# requires-python = ">=3.12"
# dependencies = ["requests", "pandas", "bs4", "prettytable"]
# ///
uv  init --script filename --python < your installed python version >

This will some comment top of your file.

# /// script
# requires-python = ">=3.12"
# dependencies = []
# ///

Now you can add package name in dependencies list or run command like this:

uv add --script filename "package_name"

Also, you can directly type package name in dependencies list. The uv read those lines before he execute the python script and install those packages for you.

More of uv:

You can use different python version of for your own needs:

  1. Listing available python version
uv python list
  1. Install different python version:
uv python install < version_number >

Old Way

If your using pip for managing the packages so you can use this methods:

Setup Python Virtual Environment (Linux)
sudo apt install python3-virtualenv

Create Virtual Environment

virtualenv -p /usr/bin/python3 env

Activate virtual environment

source env/bin/activate

for deactivation

deactivate

Install required Libraries

pip3 install -r requirement.txt

Setup Python Virtual Environment (Windows)

Create Virtual Environment

python -m venv env

Activate virtual environment

.\env\Scripts\activate

for deactivation

deactivate

Windows

  1. Create virual env:
python -m venv env
  1. Activate
env\Scripts\activate
  1. deactivate
deactivate

Install required Libraries

pip install -r requirement.txt

Ref:

  1. UV Docs .

  2. UV GitHub.

About

Python Practice codes are stored here

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages