Step into the world of software development with Python's powerful features and the Pip package manager. Realize your projects with simple syntax, rich libraries and easy package management.
Clear and simple language structure
Thousands of ready modules with pip
Isolated development environments
Different programming approaches
An easy-to-learn and versatile programming language
Python is a high-level, interpreted programming language developed by Guido van Rossum in 1991 .
Python has a design that emphasizes readability and clean syntax. This feature provides ease of learning for beginners and simplifies code maintenance for experienced developers. Founded on the philosophy that "there should only be one way to do something," Python encourages code to be understandable and consistent.
There are two main widely used versions of Python: Python 2 and Python 3. Official support for Python 2 ended in 2020 , and it is recommended to use Python 3 for new projects.
# Python 2
print "Merhaba, Dünya!"
# Python 3
print("Merhaba, Dünya!")
Data processing, analysis and visualization with libraries such as NumPy, Pandas, Matplotlib and SciPy.
Developing AI and ML applications with libraries such as TensorFlow, PyTorch, scikit-learn.
Creating web applications and APIs with frameworks such as Django, Flask, FastAPI.
System administration, test automation and automating repetitive tasks.
It is very easy to start programming with Python. Here's a simple "Hello World" example:
# İlk Python programımız
print("Merhaba, Python Dünyası!")
# Değişken kullanımı
ad = "Ahmet"
yas = 30
print(f"{ad} {yas} yaşındadır.")
# Basit bir fonksiyon
def selamla(isim):
return f"Merhaba, {isim}!"
# Fonksiyonu çağırma
mesaj = selamla("Ayşe")
print(mesaj)
Key to access thousands of packages in the Python ecosystem
Pip (Pip Installs Packages) is the standard package management system for Python. It is the primary tool used to manage the package ecosystem of the Python programming language.
pip --version
# veya
pip -V
Pip works via the command line interface and provides package management with various subcommands. Here are the most common pip commands:
# Temel paket kurulumu
pip install paket_adi
# Belirli bir version kurma
pip install paket_adi==1.0.0
# En son version kurma
pip install --upgrade paket_adi
# veya
pip install -U paket_adi
# Sürüm aralığı belirtme
pip install "paket_adi>=1.0.0,<2.0.0"
# Kurulu paketleri listeleme
pip list
# Detailed liste
pip list -v
# Güncellenebilir paketleri bulma
pip list --outdated
# Paket arama
pip search paket_adi # Not: Bu komut artık kullanımdan kaldırılmıştır.
# Paket kaldırma
pip uninstall paket_adi
# Etkileşimli kaldırma (onay sorarak)
pip uninstall -y paket_adi
# Paket hakkında bilgi
pip show paket_adi
# Detailed bilgi
pip show -v paket_adi
You can use pip and a requirements.txt file to manage your project's dependencies and allow for reproducibility across different machines.
# Tüm kurulu paketleri dışa aktarma
pip freeze > requirements.txt
# Çıktı örneği (requirements.txt içeriği):
# numpy==1.21.0
# pandas==1.3.0
# matplotlib==3.4.2
# scikit-learn==0.24.2
# requirements.txt'deki all paketleri kurma
pip install -r requirements.txt
# Web uygulama gereksinimleri
Flask>=2.0.0,<3.0.0
SQLAlchemy==1.4.23
python-dotenv==0.19.0
# Veri işleme
pandas>=1.3.0
numpy>=1.20.0
# Test araçları
pytest==6.2.5
Virtual environments, special Python environments used to isolate the dependencies of different Python projects from each other. They allow each project to manage its own dependencies and versions without affecting the main system.
# Virtual ortam createma
python -m venv proje_ortami
# Windows'ta sanal ortamı aktifleştirme
proje_ortami\Scripts\activate
# Unix/macOS'ta sanal ortamı aktifleştirme
source proje_ortami/bin/activate
# Virtual ortamı devre dışı bırakma
deactivate
# Virtual ortamı aktifleştirdikten sonra:
# Paket kurulumu
pip install numpy pandas matplotlib
# Gereksinimleri dışa aktarma
pip freeze > requirements.txt
# Başka bir ortamda same paketleri kurma
pip install -r requirements.txt
Examples of using pip in real projects
# 1. Virtual ortam createma
python -m venv veri_analizi_ortami
source veri_analizi_ortami/bin/activate # Unix/macOS
# veya
veri_analizi_ortami\Scripts\activate # Windows
# 2. Gerekli paketleri kurma
pip install numpy pandas matplotlib seaborn scikit-learn jupyter
# 3. Jupyter Notebook başlatma
jupyter notebook
# 4. Projectctyi bitirince gereksinimleri kaydetme
pip freeze > requirements.txt
# 5. Virtual ortamdan çıkma
deactivate
Description: In this scenario, we are creating an isolated environment that includes the basic packages required for data analysis. Interactive data analysis can be performed using Jupyter Notebook, and all dependencies are recorded in the file.
# 1. Virtual ortam createma
python -m venv web_app_env
source web_app_env/bin/activate # Unix/macOS
# 2. Flask ve bağımlılıklarını kurma
pip install flask flask-sqlalchemy flask-login python-dotenv
# 3. Development sırasında yeni bağımlılıklar ekleme
pip install flask-wtf flask-migrate
# 4. Projectctyi canlıya almak for gereksinimleri kaydetme
pip freeze > requirements.txt
click==8.0.1
Flask==2.0.1
Flask-Login==0.5.0
Flask-Migrate==3.1.0
Flask-SQLAlchemy==2.5.1
Flask-WTF==0.15.1
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
python-dotenv==0.19.0
SQLAlchemy==1.4.23
Werkzeug==2.0.1
WTForms==2.3.3
Description: In this scenario, we are developing a web application using the Flask web framework and its related extensions. As we add new packages during the development process, we record all dependencies along with their versions.
# 1. Test for sanal ortam createma
python -m venv test_env
test_env\Scripts\activate # Windows
# 2. Test araçlarını kurma
pip install pytest pytest-cov pytest-mock requests-mock
# 3. Test kapsamına special paketleri kurma
pip install -e . # Mevcut paketi development modunda kurma
# 4. Test çalıştırma
pytest --cov=proje_adi tests/
# 5. CI/CD sistemi for gereksinimleri kaydetme
pip freeze > test-requirements.txt
Description: In this scenario, we set up a Python project's test environment. Pytest and its plugins enable comprehensive tests, editable package installation with `-e .`, and coverage reporting.