Не уверен, что вы имеете в виду, но вы можете создать простой графический интерфейс в Python, например, который позволяет вашим пользователям выбирать параметры из списков, а затем записывает файл "settings" для программы FORTRAN и запускает ее, когданажата кнопка:
#!/usr/local/bin/python3
from guizero import App, ListBox, Text, PushButton
def StartThatPuppy():
print("Starting FORTRAN...")
# Write currently selected settings to config file
# subprocess.call('/Users/fred/program.exe')
app = App(title="FORTRAN Parameter Setup", width=300, height=200)
t=Text(app, text="Select optimisation method")
listbox = ListBox(app,
items=["Method A", "Method B", "Method C (beta)", "Naive Method"],
selected="Method B",
scrollbar=True)
listbox.height=3
listbox.width=20
t=Text(app, text="Select threshold")
listbox = ListBox(app,
items=["1%", "2%", "5%", "10%"],
selected="5%",
scrollbar=True)
listbox.height=3
listbox.width=20
button = PushButton(app, text="Start FORTRAN", command=StartThatPuppy)
app.display()
Это выглядит так:
![enter image description here](https://i.stack.imgur.com/BQ3Qp.png)
Дополнительные примеры и документация здесь .
В качестве альтернативы, если вы хотите что-то текстовое, без графического интерфейса, вы можете использовать whiptail
как raspi-config
в RaspberryPi:
![enter image description here](https://i.stack.imgur.com/0dGlF.png)
Другой вариант может быть dialog
, документация здесь
Это может выглядеть так:
dialog --title "FORTRAN Parameter Setup" "$@" \
--checklist "You can choose your threshold here.\n\
Press SPACE to toggle an option on/off. \n\n\
What threshold do you want?" 20 61 5 \
"1%" "Default threshold" ON \
"2%" "Less sensitive" off \
"5%" "Can be noisy" off \
"Unlimited" "Potentially too many results" off
retval=$?
![enter image description here](https://i.stack.imgur.com/78xrl.png)