推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Webpir
V2EX  ›  Python

关于 Python 脚本重复执行

  •  
  •   Webpir · Dec 14, 2017 · 4606 views
    This topic created in 3098 days ago, the information mentioned may be changed or developed.
    一个小问题。用 pyinstaller 打包成 EXE 之后。是可以重复执行的,多次执行后会出现很多窗口。
    怎样才能让这个 EXE 只能同时打开一次?
    是通过控制进程吗?有没有其他更有效的办法?
    2 replies    2017-12-15 19:25:51 +08:00
    Aliencn
        1
    Aliencn  
       Dec 15, 2017
    我一般最懒的方法是程序启动后先占用一个端口。
    有时候也会用生成 pid 文件的方法
    qile1
        2
    qile1  
       Dec 15, 2017 via Android
    我是把 pid 写配置文件,在启动时候读取 pid 结束程序在启动,现在在想如何在程序启动后,通过啥方式让别程序调用 exe 后传参进来!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1029 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:10 · PVG 03:10 · LAX 12:10 · JFK 15:10
    ♥ Do have faith in what you're doing.