Skip to content

A beginner-friendly guide in Sinhala for setting up and managing Python projects. Includes essential commands for checking Python versions, creating virtual environments, installing packages with pip, and organizing projects. Perfect for new Python developers!

Notifications You must be signed in to change notification settings

AkalankaKaushalya/Python_Basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

🐍 Python Development – Basic Setup & Commands Guide

මෙය Python Developer කෙනෙකුට project එකක් ආරම්භ කරන කලින් වැදගත්ම මූලික උපදෙස්/කමාන්ඩ් ලැයිස්තුවකි.


🔍 1. Python Installed Version එක පරීක්ෂා කිරීම

ඔබේ system එකේ Python install වී ඇද්දැයි සහ version එක කුමක්දැයි බලන්න:

py --version

උදාහරණ output:

Python 3.10.9

📜 2. System එකේ install කරලා තියෙන Python version list එක බැලීම

py -0

උදාහරණ output:

 -3.13-64
 -3.11-64 *
 -3.10-64

💡 * තියෙන්නේ default version එක.

🔧 3. විශේෂ Python version එකක් Select කරගැනීම (Run කිරීම)

ඔබට install කරලා තියෙන විශේෂ version එකක් Run කරන්න පුලුවන් මෙහෙමයි:

py -3.10 --version

හෝ

py -3.10 your_script.py

🌱 4. Virtual Environment (venv) එකක් setup කිරීම (Python project එකට)

Python project එකකට අදාළව isolate කරන virtual environment එකක් නිර්මාණය කරන්න:

py -3.10 -m venv env

🔹 මෙය env/ නමැති folder එකක් හදනවා, ඒ තුල Python binaries, pip, හා site packages isolate වෙලා තියේ.

🚀 5. Virtual Environment එක activate කිරීම

Windows:

env\Scripts\activate

Linux / macOS:

source env/bin/activate

Activate වුනාට පසු terminal එකේ (env) කියලා පේනවා.

🧯 6. Virtual Environment එක deactivate කිරීම

deactivate

📦 7. Packages install කිරීම (pip භාවිතයෙන්)

pip install package_name

උදාහරණ:

pip install requests

📂 8. ඔබ install කරලා තියෙන packages ලැයිස්තුව බලන්න

pip list

🗃️ 9. ඔබ install කරලා තියෙන packages freeze (requirements file එකක් සදාගැනීම)

pip freeze > requirements.txt

මෙම file එක project එක සමඟ share කරොත්, වෙන කෙනෙකුට ඒම packages install කරන්න පුළුවන්:

pip install -r requirements.txt

🔄 10. pip update කිරීම (Optional)

python -m pip install --upgrade pip

💡 අමතර උපදෙස්

  • VS Code භාවිතා කරනවා නම් .venv කියන folder එක ignore කරන්න .gitignore තුල.
  • main.py හෝ app.py ලෙස main file එකක් තබාගන්න.
  • Source files src/ folder එකක් තුල තබාගන්න.
  • Python version එක consistent කරගෙන යන්න pyenv වගේ tools පාවිච්චි කරන්න පුළුවන් (Linux/macOS).

📚 Reference Commands Recap

Task Command
Check Python version py --version
List installed Python versions py -0
Run script with specific Python version py -3.10 script.py
Create virtual environment py -3.10 -m venv env
Activate venv (Windows) env\Scripts\activate
Activate venv (Unix/Mac) source env/bin/activate
Deactivate venv deactivate
Install package pip install package_name
List packages pip list
Export packages pip freeze > requirements.txt
Install from requirements.txt pip install -r requirements.txt

🎉 ඔබ දැන්මම Python project එකක් start කරන්න සූදානම්!


මෙම .md file එක ඔබට GitHub README එකක් විදියටද, VS Code NOTES.md එකක් විදියටද භාවිතා කළ හැක.

About

A beginner-friendly guide in Sinhala for setting up and managing Python projects. Includes essential commands for checking Python versions, creating virtual environments, installing packages with pip, and organizing projects. Perfect for new Python developers!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published