代码拉取完成,页面将自动刷新
#! /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()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。