# -*-coding:utf-8-*-
"""
1)页面布局
2)基本文本编辑功能,增删改查替
3)编码选择
4)大小写,url编码
5)新建
6)打开
7)保存/另存为
"""
# GUI界面编程
from tkinter import * # 控件基础包,导入这个包后,这个包下的所有函数可以直接调用
from tkinter import filedialog, messagebox
from tkinter.ttk import Combobox
from urllib.parse import quote
class MainWin():
# 顶层窗口
def __init__(self):
top_button_width = 10
button_relief = RAISED
# 创建顶层窗口
root = Tk()
self.src_filename = None
self.count = StringVar()
self.count.set('0')
# root.geometry(str(win_width)+'x750') # 初始化窗口大小
root.title('简易的文本记事器')
# 宽不可变, 高可变,默认为True
root.resizable(width=False, height=False)
# 上部控件
Button(root, text='打开', relief=button_relief, width=top_button_width, command=self.open_button_event) \
.grid(row=0, column=0)
Button(root, text='新建', relief=button_relief, width=top_button_width, command=self.new_button_event) \
.grid(row=0, column=1)
Button(root, text='保存', relief=button_relief, width=top_button_width,
command=self.new_button_event).grid(row=0, column=2, sticky=E)
Button(root, text=
python实现的记事本
最新推荐文章于 2024-06-26 19:55:17 发布
本文介绍如何利用Python编程创建一个简单的记事本应用,适合初学者和想要提升Python技能的开发者。通过该实践,你可以学习到文件操作、GUI界面设计等知识。
摘要由CSDN通过智能技术生成