Python基于Tkinter实现的记事本实例
作者:杨明晖 时间:2021-12-30 09:25:17
本文实例讲述了Python基于Tkinter实现的记事本。分享给大家供大家参考。具体如下:
from Tkinter import *
root = Tk('Simple Editor')
mi=StringVar()
Label(text='Please input something you like~' ).pack()
te = Text(height = 30,width =100)
te.pack()
Label(text=' File name ').pack(side = LEFT)
Entry(textvariable = mi).pack(side = LEFT)
mi.set('*.txt')
def save():
t = te.get('0.0','10.0')
f = open(mi.get(),'w')
f.write(t)
Button(text = 'Save' , command = save).pack(side = RIGHT)
Button(text = 'Exit' , command = root.quit).pack(side = RIGHT)
mainloop()
希望本文所述对大家的Python程序设计有所帮助。
标签:Python,Tkinter
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
asp+XMLHTTP的国际域名查询系统(whois)源代码
2008-02-16 09:23:00
Python3压缩和解压缩实现代码
2022-05-04 09:42:19
Oracle批量查询、删除、更新使用BULK COLLECT提高效率
2023-07-14 03:15:52
使用PowerShell实现批量修改或替换文件名
2023-02-08 05:02:10
![](https://img.aspxhome.com/file/2023/0/120920_0s.png)
下一站:HandlerSocket!
2011-04-11 09:02:00
Ubuntu下使用python读取doc和docx文档的内容方法
2021-04-09 03:42:30
使用xml http为网站增加域名查询功能
2008-05-29 13:42:00
浅谈Python描述数据结构之KMP篇
2022-06-09 19:36:23
![](https://img.aspxhome.com/file/2023/9/66869_0s.jpg)
NumPy迭代数组的实现
2022-01-03 14:07:37
Python SQLite3数据库操作类分享
2023-08-24 01:04:02
python腾讯语音合成实现过程解析
2022-01-01 20:58:05
python开发利器之ulipad的使用实践
2021-07-25 00:55:17
![](https://img.aspxhome.com/file/2023/8/90618_0s.jpg)
Oracle REGEXP_LIKE模糊查询用法例子
2023-07-19 08:26:22
![](https://img.aspxhome.com/file/2023/8/64448_0s.png)
asp中利用xmlhttp抓取网页内容的代码
2023-07-06 04:18:12
SQL Server数据在不同数据库中的应用
2008-12-24 15:34:00
Python创建增量目录的代码实例
2021-12-07 04:12:55
![](https://img.aspxhome.com/file/2023/6/105366_0s.png)
python opencv 批量改变图片的尺寸大小的方法
2021-09-13 12:55:01
![](https://img.aspxhome.com/file/2023/2/107212_0s.jpg)
django filter过滤器实现显示某个类型指定字段不同值方式
2023-06-21 07:48:26
![](https://img.aspxhome.com/file/2023/1/107001_0s.jpg)
不成熟的标准化是我们唯一惧怕的
2008-08-15 18:55:00
Python字典使用技巧详解
2021-09-07 23:54:25