我有一个固定的2小时工作(四个30分钟部分),我想从Python控制台应用程序的菜单选项中启动。你能帮我设计一下吗?Python控制台应用程序设计状态和交互
当用户单击菜单选项启动作业时,我想在作业运行时给出某种状态。也许显示每个部分30分钟倒计时。
我希望能够通过菜单选项(而不是键盘中断)取消作业。
因此,程序的交互式部分仍然允许用户在作业运行时检查其他菜单选项。
My initial questions are below. I know I can research most of these but I want To know if I'm asking myself the right questions.
1. Would the job need to run in the background? If so, how can I cancel something in the background?
2. Best way to initiate to background?
3. Can I show 30 min count down, while still maintaining the interactivness?
粗糙说明:
Running Jobs:
Job 1: 29:30 time left
Interactive console menu:
1. Start Job 1 - started
2. Do other things
3. Exit
你提到的这份工作到底是什么?它是一个Python函数或什么? – skyline75489
是的,这是一个Python程序。 – Rod
另一个python脚本或只是一个函数? – skyline75489