"""Entry point of the "The Kurgan hardware" Windows service (KurganHw); see kurgan/hw/winservice.py. The service manager runs it with the base interpreter (setup.ps1 installs it): "\\python.exe" -I -S -B "C:\\Dev\\the_kurgan\\hw_service.py" -I: isolated (no PYTHON* variables, no user site-packages, no current folder on the path); -S: no automatic site-packages; -B: no .pyc files written into the repo by SYSTEM. This file adds the repo and its .venv's packages, so the base interpreter's own packages are never loaded. ... hw_service.py --check can the service start? (setup.ps1 runs this before installing) ... hw_service.py [-v] run it in a console instead (elevated, with the service stopped) """ import os import site import sys HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) site.addsitedir(os.path.join(HERE, ".venv", "Lib", "site-packages")) # runs pywin32's .pth bootstrap from kurgan.hw.winservice import main # noqa: E402 sys.exit(main())