python学习 (三十六) wxpython

Pycharm 里安装wxPython 并且用Pyinstaller打包:

1: pycharm,   File  ->  Setting ->  Project Interpreter, 点击加号,安装wxpython,

然后安装PyInstaller.

2:   建立一个文件  gui.py, 写一个hello world的wxpython程序。

# First things, first. Import the wxPython package.
import wx

# Next, create an application object.
app = wx.App()

# Then a frame.
frm = wx.Frame(None, title="Hello World")

# Show it.
frm.Show()

# Start the event loop.
app.MainLoop()

3: 运行PyInstaller -F gui.py,

      就会生成一个dist文件,里面就是打包的python程序,可以双击运行。

猜你喜欢

转载自www.cnblogs.com/liufei1983/p/13193168.html