Python

basic

python 실행 python (py)
python 종료 ctrl + D or exit()
python file 실행 python sample.py, py sample.py
python 버전 확인 python -V, py -V

pip(legacy)

pip commands

uv

install

# macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# With pip
pip install uv

# With brew (macOS)
brew install uv

uv commands

# Install packages
uv pip install requests
uv pip install -r requirements.txt

# Create virtual environment
uv venv
uv venv venv  # with custom name

# Activate virtual environment
source .venv/bin/activate  # macOS/Linux
.venv\Scripts\activate     # Windows

# Install packages in virtual environment
uv pip install pandas numpy

# Freeze dependencies
uv pip freeze > requirements.txt

# Uninstall packages
uv pip uninstall requests

# List installed packages
uv pip list

# Sync dependencies (like pip-sync)
uv pip sync requirements.txt

uv features

virtualenv (legacy)

python3 (mac)

brew install python3
virtualenv -p python3 venv3
source venv3/bin/activate

python -V
deactivate

mac

backend: TkAgg

파일

문자열(String)

list(array)

scipy on windows

ref

What Else?
inflearn react api server -50% 할인쿠폰: 20652-ab1f1cd4c373 buy me a coffee