"""Lesson 1: project structure, pathlib and virtual environments."""
from pathlib import Path
import sys

HERE = Path(__file__).resolve().parent          # folder of this script, wherever you run it from
print("Python", sys.version.split()[0])
print("In a virtual environment:", sys.prefix != sys.base_prefix)
data = HERE / "sales.csv"
print("sales.csv exists:", data.exists(), "| size in KB:", round(data.stat().st_size / 1024, 1))
csvs = sorted(p.name for p in (HERE / "monthly").glob("*.csv"))
print("Monthly files:", csvs)
out = HERE / "output"; out.mkdir(exist_ok=True)
(out / "hello.txt").write_text("Created by lesson 1\n", encoding="utf-8")
print("Wrote", (out / "hello.txt").relative_to(HERE))
print("Stem / suffix of first file:", Path(csvs[0]).stem, Path(csvs[0]).suffix)
