main.py: menu a ciclo fino a scelta 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 4.6 committed 2026-05-14 10:08:41 +02:00
1 parent c477c5c765
commit 600b4f6dfa
1 file changed
+3 -2
+3 -2
View File
@@ -13,6 +13,7 @@ MENU = [
] ]
def main(): def main():
while True:
print("\n=== Analisi Termica Forno ===\n") print("\n=== Analisi Termica Forno ===\n")
for i, (label, _) in enumerate(MENU, 1): for i, (label, _) in enumerate(MENU, 1):
print(f" {i}. {label}") print(f" {i}. {label}")
@@ -20,10 +21,10 @@ def main():
scelta = input("Scegli: ").strip() scelta = input("Scegli: ").strip()
if scelta == "0": if scelta == "0":
return break
if not scelta.isdigit() or not (1 <= int(scelta) <= len(MENU)): if not scelta.isdigit() or not (1 <= int(scelta) <= len(MENU)):
print("Scelta non valida.") print("Scelta non valida.")
return continue
_, script = MENU[int(scelta) - 1] _, script = MENU[int(scelta) - 1]
subprocess.run([sys.executable, str(script)]) subprocess.run([sys.executable, str(script)])