Files

39 lines
1.1 KiB
Python
Raw Permalink Normal View History

import subprocess
import sys
from pathlib import Path
BASE = Path(__file__).parent
def build_menu() -> list[tuple[str, Path]]:
menu = [
("Calcola T ambiente", BASE / "start" / "calcola_t_amb.py"),
("Plot dati raw", BASE / "start" / "plot_temperatura.py"),
]
for folder in sorted(BASE.glob("induttore*/")):
for script in sorted(folder.glob("app*.py")):
menu.append((f"{folder.name} — {script.name}", script))
menu.append(("Report completo (PDF + LaTeX)", BASE / "report_completo.py"))
return menu
def main():
2026-05-14 10:08:41 +02:00
while True:
menu = build_menu()
2026-05-14 10:08:41 +02:00
print("\n=== Analisi Termica Forno ===\n")
for i, (label, _) in enumerate(menu, 1):
2026-05-14 10:08:41 +02:00
print(f" {i}. {label}")
print(" 0. Esci\n")
2026-05-14 10:08:41 +02:00
scelta = input("Scegli: ").strip()
if scelta == "0":
break
if not scelta.isdigit() or not (1 <= int(scelta) <= len(menu)):
2026-05-14 10:08:41 +02:00
print("Scelta non valida.")
continue
_, script = menu[int(scelta) - 1]
2026-05-14 10:08:41 +02:00
subprocess.run([sys.executable, str(script)])
if __name__ == "__main__":
main()