Skip to main content

limit python script just run a single process

Project description

README

SETUP

pip install -U single_process

USE

Limit python script just run a single process, support python3

Use only need to directly import single_process.init module (no need for any function call)

import single_process.init

Of course, you can also manually call the single_process function

from single_process import single_process

single_process()

def main():
    from time import sleep
    sleep(6000)

if __name__ == "__main__":
    main()

中文说明

安装

pip install -U single_process

使用

限制一个python脚本只运行一个进程,支持python3 使用只需要直接 import single_process.init 模块(不需要任何函数调用)

import single_process.init

当然,你也可以手工调用 single_process 函数

from single_process import single_process

single_process()

def main():
    from time import sleep
    sleep(6000)

if __name__ == "__main__":
    main()

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

single_process-2.4.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file single_process-2.4.1.tar.gz.

File metadata

File hashes

Hashes for single_process-2.4.1.tar.gz
Algorithm Hash digest
SHA256 6e548dc4aeb1a62e9d0662efa5ca6ac14a92961d51bf466b8214ad6b031768fa
MD5 b3cb0a4c77ff90d9d56db7d024ae2213
BLAKE2b-256 85e1de76f978d3c8e1ff1bf36176ca7bc1af2611b510ec523ea86ddf11c423fa

See more details on using hashes here.

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