Skip to main content

Win基础模块

Project description

基础组件

发布历史

0.0.1 初始版

安装

pip install co6co_win

from pathlib import Path

class WinserviceDemo(Winservice):
    _svc_name_ = "pythonService"
    _svc_display_name_ = "pythonService"
    _svc_description_ = "pythonService"
    # _exe_name_ = "C:\\Users\\Administrator\\envs\\win32\\pythonservice.exe"

    def start(self):
        self.isrunning = True

    def stop(self):
        self.isrunning = False

    def main(self):
        """
        执行自己的代码
        """
        i = 0
        while self.isrunning:
            random.seed()
            x = random.randint(1, 1000000)
            Path(f"C:/{x}.txt").touch()
            time.sleep(5)
        Path(f'c:/1.txt').touch()

# 调用方法
if __name__ == '__main__':
    WinserviceDemo.parse_command_line()

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

co6co_win-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file co6co_win-0.0.1.tar.gz.

File metadata

  • Download URL: co6co_win-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.4

File hashes

Hashes for co6co_win-0.0.1.tar.gz
Algorithm Hash digest
SHA256 892b5a96a0e8e307427cfddbcee5272fb6aec7a41046562c96cbc852d1b96d7c
MD5 863f32d36ec7efe2e629d145dd9e3cfc
BLAKE2b-256 dddb36b1e0546a135f3c4893c6541330c2a7f2c488c315261bc6070b0ccce1e7

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