mirror of
https://github.com/muziing/Py2exe-GUI.git
synced 2025-01-27 17:02:55 +08:00
Add "Run as Script" program entry
增加以脚本形式启动主程序的入口方式;
This commit is contained in:
parent
68fad69821
commit
b63134e895
@ -48,6 +48,12 @@ pip install py2exe-gui
|
||||
|
||||
Run:
|
||||
|
||||
```shell
|
||||
py2exe-gui
|
||||
```
|
||||
|
||||
You can run py2exe-gui as a package if running it as a script doesn't work:
|
||||
|
||||
```shell
|
||||
python -m py2exe_gui # `_`, not `-`
|
||||
```
|
||||
|
@ -48,6 +48,12 @@ pip install py2exe-gui
|
||||
|
||||
运行
|
||||
|
||||
```shell
|
||||
py2exe-gui
|
||||
```
|
||||
|
||||
如果以脚本形式运行失败,还可以尝试作为 Python 包运行:
|
||||
|
||||
```shell
|
||||
python -m py2exe_gui # 注意连字符为_
|
||||
```
|
||||
|
@ -12,6 +12,9 @@ exclude = ["src/py2exe_gui/Resources/Icons", "src/py2exe_gui/Resources/Texts"]
|
||||
[tool.poetry.urls]
|
||||
"Bug Tracker" = "https://github.com/muziing/Py2exe-GUI/issues"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
py2exe-gui = 'py2exe_gui.__main__:main'
|
||||
|
||||
#[[tool.poetry.source]]
|
||||
#name = "tsinghua_mirror"
|
||||
#url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
|
||||
|
@ -57,8 +57,16 @@ class MainApp(MainWindow):
|
||||
super().closeEvent(event)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
"""
|
||||
应用程序主入口函数
|
||||
"""
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
window = MainApp()
|
||||
window.show()
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user