Python

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:48 PM on 3/31/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

7 Terms

1
New cards

What are poetry and uv, why are they useful

Both are Python package managers that handle dependency resolution, lockfiles, and virtual environment creation.

2
New cards

What are the basic commands to start a new python project with uv

uv init project-name — scaffold a new project with pyproject.toml

uv add requests — add a dependency

uv remove requests — remove a dependency

uv sync — install all deps from lockfile

uv run main.py — run a script in the managed environment

3
New cards

What are common uv commands when working on projects?

uv add --dev pytest — add a dev dependency
uv sync — install/update all deps from lockfile

uv run command — run any command in the project environment (without you needing to manually activate it.) not needed if venv already active

uv lock — regenerate the lockfile without installing

uv tree — show dependency tree

4
New cards

What's the difference between carrot and tilde in package versions

Caret (^2.31.0): Allows changes that don't modify the leftmost non-zero digit. ^2.31.0 → ≥2.31.0, <3.0.0. (Poetry's default)

Tilde (~=2.31.0): Allows only patch-level changes. ~=2.31.0 → ≥2.31.0, <2.32.0.

In short: Caret is more permissive (any minor/patch bump), tilde is stricter (patch bumps only).

Semantic Versioning (SemVer): MAJOR.MINOR.PATCH

MAJOR (2.x.x) — breaking/incompatible API changes

MINOR (x.31.x) — new features, backwards compatible

PATCH (x.x.5) — bug fixes, backwards compatible

5
New cards

Why should we use a new virtual environment for every project?

Dependency isolation — different projects may need different versions of the same package. Without separate envs, they conflict.

Reproducibility — each project has only its own dependencies, making it easy to generate accurate lockfiles and replicate the setup elsewhere.

Clean uninstall — delete the env and everything's gone. No leftover packages polluting other projects or the system Python.

6
New cards

What does scaffolding mean?

Scaffolding = the automatic generation of a basic project structure or boilerplate code to help you start development faster.

It typically creates things like:

  • folders and files

  • starter code

  • default configuration

  • basic CRUD pages or routes

7
New cards

What is the init.py file?

__init__.py marks a directory as a Python package so that python treats it as such, so Python can import modules from it.

It can also run package initialization code when the package is imported.

Explore top notes

note
Chapter 4: Forces and Energy
Updated 1218d ago
0.0(0)
note
Unit 8: Ecology
Updated 95d ago
0.0(0)
note
Day 3
Updated 499d ago
0.0(0)
note
Chapter 13: Illicit Drugs
Updated 1092d ago
0.0(0)
note
excretory system notes
Updated 1176d ago
0.0(0)
note
Chapter 4: Forces and Energy
Updated 1218d ago
0.0(0)
note
Unit 8: Ecology
Updated 95d ago
0.0(0)
note
Day 3
Updated 499d ago
0.0(0)
note
Chapter 13: Illicit Drugs
Updated 1092d ago
0.0(0)
note
excretory system notes
Updated 1176d ago
0.0(0)

Explore top flashcards

flashcards
Flashcards pro zeměpis
80
Updated 316d ago
0.0(0)
flashcards
VET213 LAB END PRACTICAL SP2023
33
Updated 1064d ago
0.0(0)
flashcards
Criminology Unit 3
20
Updated 1234d ago
0.0(0)
flashcards
Econ Exam 2
66
Updated 1121d ago
0.0(0)
flashcards
W27 vocab (Klinh + Btram)
45
Updated 418d ago
0.0(0)
flashcards
El tiempo/ Que tiempo hace?
21
Updated 1204d ago
0.0(0)
flashcards
confirmation
32
Updated 980d ago
0.0(0)
flashcards
Speedtest Fische
25
Updated 62d ago
0.0(0)
flashcards
Flashcards pro zeměpis
80
Updated 316d ago
0.0(0)
flashcards
VET213 LAB END PRACTICAL SP2023
33
Updated 1064d ago
0.0(0)
flashcards
Criminology Unit 3
20
Updated 1234d ago
0.0(0)
flashcards
Econ Exam 2
66
Updated 1121d ago
0.0(0)
flashcards
W27 vocab (Klinh + Btram)
45
Updated 418d ago
0.0(0)
flashcards
El tiempo/ Que tiempo hace?
21
Updated 1204d ago
0.0(0)
flashcards
confirmation
32
Updated 980d ago
0.0(0)
flashcards
Speedtest Fische
25
Updated 62d ago
0.0(0)