欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

[Windows][Python] GUI设计

程序员文章站 2022-03-02 13:32:24
...

Make a GUI on Windows X

  1. Setup python

  2. Install pip

    1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    2. python get-pip.py
  3. Install Pyinstaller

    pip install PyInstaller
  4. Write a GUI code

    import wx
    app = wx.App()
    win = wx.Frame(None, title="Simple Editor", size=(410,335))
    OpenBtn = wx.Button(win, label="Open", pos=(225,5), size=(80,25))
    SaveBtn = wx.Button(win, label="Save", pos=(315,5), size=(80,25))
    filename = wx.TextCtrl(win,pos=(5,5), size=(210,25))
    contents = wx.TextCtrl(win,pos=(5,35), size=(390,260), style=wx.TE_MULTILINE|wx.HSCROLL)
    win.Show()
    app.MainLoop()
  5. make a GUI.exe

    pyinstaller -F -w GUI.py