python实现的记事本

# -*-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=
  • 4
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值