seedling tray generation script

This commit is contained in:
2026-09-03 17:25:11 +02:00
parent c414d77ddb
commit 17962d6ff4
4 changed files with 128 additions and 12 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/bin/python3
from __future__ import annotations
def ask_int(prompt: str) -> int:
"""Prompt user for a positive integer."""
while True:
try:
value = int(input(prompt).strip())
if value <= 0:
print("Please enter a positive integer.")
continue
return value
except ValueError:
print("Please enter a valid integer.")
def ask_float(prompt: str) -> float:
"""Prompt user for a positive float."""
while True:
try:
value = float(input(prompt).strip())
if value <= 0:
print("Please enter a positive number.")
continue
return value
except ValueError:
print("Please enter a valid number.")