我有一個固定的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