Skip to main content

nb_libs

Project description

各种日常工具

安装

pip install nb_libs

1. restart_program每隔多久重启代码自身。

import time
import datetime
from nb_libs.restart_programe_by_interval import restart_program


def _run():
    print(datetime.datetime.now(), '开始运行程序')
    for i in range(1000):
        time.sleep(0.5)
        print(datetime.datetime.now(), i)


if __name__ == '__main__':
    restart_program(10)  # 每隔10秒重启。
    _run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nb_libs-0.3.tar.gz (1.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page