How to “stop” and “resume” long time running Python script?

前端 未结 3 1486
甜味超标
甜味超标 2020-12-09 20:32

I wrote Python script that processes big number of large text files and may run a lot of time. Sometimes, there is a need to stop the running script and to

3条回答
  •  一向
    一向 (楼主)
    2020-12-09 21:15

    The execution could sleep it's life away, or (aside from the exceptions of security), the state of the script can be pickled, zipped, and stored.

    http://docs.python.org/library/pickle.html

    http://docs.python.org/library/marshal.html

    http://docs.python.org/library/stdtypes.html (5.9)

    http://docs.python.org/library/archiving.html

    http://www.henrysmac.org/?p=531

提交回复
热议问题