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
+13 -12
+13 -12
View File
@@ -13,20 +13,21 @@ MENU = [
]
def main():
print("\n=== Analisi Termica Forno ===\n")
for i, (label, _) in enumerate(MENU, 1):
print(f" {i}. {label}")
print(" 0. Esci\n")
while True:
print("\n=== Analisi Termica Forno ===\n")
for i, (label, _) in enumerate(MENU, 1):
print(f" {i}. {label}")
print(" 0. Esci\n")
scelta = input("Scegli: ").strip()
if scelta == "0":
return
if not scelta.isdigit() or not (1 <= int(scelta) <= len(MENU)):
print("Scelta non valida.")
return
scelta = input("Scegli: ").strip()
if scelta == "0":
break
if not scelta.isdigit() or not (1 <= int(scelta) <= len(MENU)):
print("Scelta non valida.")
continue
_, script = MENU[int(scelta) - 1]
subprocess.run([sys.executable, str(script)])
_, script = MENU[int(scelta) - 1]
subprocess.run([sys.executable, str(script)])
if __name__ == "__main__":
main()