# Chapter 2: Installing and Running Python
# Fundamentals of Python for Financial Econometrics - Installing and Running Python
# Dataset: Ceteris Lab teaching sample

# Installing and Running Python
#
# **Opening question:** What is the least fragile way to move from “I have a computer” to a working, reproducible Python environment?

# %% Cell 2
import platform
import sys

print(sys.version.split()[0])
print(sys.executable)
print(platform.system())

# **Interpretation check:** Interpretation. Your path will differ. The important point is that the notebook and the environment should refer to the same interpreter.

# %% Cell 4
from pathlib import Path

project = Path.cwd()
data_dir = project / "data" / "frozen"
print(data_dir.relative_to(project).as_posix())
print(data_dir.exists())

# **Interpretation check:** Interpretation. pathlib joins folders without hard-coded slashes and makes the intended location explicit.

# %% Cell 6
import platform
import sys
print(sys.version.split()[0])
print(sys.executable)
print(platform.system())
from pathlib import Path

# Verified source output
#
# ```text
# 3.13.5 /opt/pyvenv/bin/python Linux
# ```
#
# ```text
# data/frozen True
# ```
#
# ```text
# 3.13.5
# /opt/pyvenv/bin/python
# Linux
# ```
#
# ```text
# data/frozen
# True
# ```
