python - Close console while process is running -
i'm writing small application uses "index-file" open folders in explorer few button presses. anyway update index file in "background process" every time applications shuts down. updating index file means scanning through our network , remote users take few minutes. that's why hide console during scanning process in order avoid process being aborted user.
i tried several things similar to:
#these dummy lines path = get_user_input() subprocess.popen(r'explorer "%s"' % path) #here start update process multiprocessing.process(target=update_index).start() #end of script, want process continue until finished while main console closes. seem 1 or other.
i tried using:
detached_process = 0x00000008 create_no_window = 0x08000000 subprocess.popen(command, shell=true, stdin=none, stdout=none, stderr=none, creationflags=detached_process|create_no_window)
and managed separate console window still no way preventing user closing down process.
also keep in mind distribute script py2exe later make accessible without python guess using pythonw.exe out of question. or?
that's not answer you're looking for, redesign system architecture: write index updater server process that's communicating actual application on sockets. have index updater server process run continuously (maybe on machine) , have index updater process time-consuming work.
Comments
Post a Comment