2 Star 0 Fork 0

shine_forever / pyTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
wx_test.py 736 Bytes
一键复制 编辑 原始数据 按行查看 历史
#! /usr/bin/python
#coding:utf-8
__author__ = 'guolt'
import wx
def openFile(evt):
file_read=open(file_path.GetValue()).read()
file_contents.SetValue(file_read)
def saveFile(evt):
file_write=open(file_path.GetValue(),'w')
file_write.write(file_contents.GetValue())
file_write.close()
app=wx.App()
win=wx.Frame(None,title="wxpython note",size=(410,340))
openb=wx.Button(win,label="open",pos=(245,5),size=(80,25))
saveb=wx.Button(win,label="save",pos=(325,5),size=(80,25))
file_path=wx.TextCtrl(win,pos=(5,5),size=(240,25))
file_contents=wx.TextCtrl(win,pos=(5,35),size=(400,300),style=wx.TE_MULTILINE|wx.HSCROLL)
openb.Bind(wx.EVT_BUTTON,openFile)
saveb.Bind(wx.EVT_BUTTON,openFile)
win.Show()
app.MainLoop()
Python
1
https://gitee.com/shine_forever/pyTest.git
git@gitee.com:shine_forever/pyTest.git
shine_forever
pyTest
pyTest
master

搜索帮助