有一个系统常驻程序,只允许一个实例运行,使用如下方法

 

 

pro=commands.getoutput("ps -C Dictionary.py | grep -c py")
if pro == "1":   
    app = QtGui.QApplication(sys.argv)
    dict=WinDict()
    dict.show()
    sys.exit(app.exec_())

 

 

相关文章: