• class12_pack_grid_place 放置位置


    其中的部分运行效果图(程序见序号1):


    #!/usr/bin/env python
    # -*- coding:utf-8 -*-
    # ------------------------------------------------------------
    #
    # 参考资料:
    # 用 python 和 tkinter 做简单的窗口视窗 - 网易云课堂
    # https://study.163.com/course/courseLearn.htm?courseId=1003216011#/learn/video?lessonId=1003650351&courseId=1003216011
    #
    #
    # ------------------------------------------------------------
    # ******************** class12_pack_grid_place 放置位置 *******************
    # ******************** class12_pack_grid_place 放置位置 *******************
    # =====>>>>>>内容概览
    # =====>>>>>>内容概览

    '''

    # ------------------------------------------------------------
    # # 1、Button 之 pack
    # ------------------------------------------------------------

    # ------------------------------------------------------------
    # # 2、Label 之 grid
    # ------------------------------------------------------------

    # ------------------------------------------------------------
    # # 3、Label 之 place 具体位置
    # ------------------------------------------------------------


    '''


    # ------------------------------------------------分割线-------------------------------------------------
    # ------------------------------------------------分割线-------------------------------------------------
    # ------------------------------------------------分割线-------------------------------------------------


    # ------------------------------------------------分割线-------------------------------------------------
    '''
    # ------------------------------------------------------------
    # # 1、Button 之 pack
    # ------------------------------------------------------------
    '''
    import tkinter as tk
    
    window = tk.Tk()
    window.title('class12_pack_grid_place 放置位置')
    window.geometry('400x300')
    
    tk.Button(window, text='top').pack(side='top')
    tk.Button(window, text='bottom').pack(side='bottom')
    tk.Button(window, text='left').pack(side='left')
    tk.Button(window, text='right').pack(side='right')
    
    window.mainloop()
    
    
    
    
    
    
    
    
    
    # ------------------------------------------------分割线-------------------------------------------------
    '''
    # ------------------------------------------------------------
    # # 2、Label 之 grid 
    # ------------------------------------------------------------
    '''
    # import tkinter as tk
    #
    # window = tk.Tk()
    # window.title('class12_pack_grid_place 放置位置')
    # window.geometry('400x300')
    #
    # for x in range(4):
    #     for y in range(3):
    #         '''
    #         grid 设置 x 行, y 列
    #         '''
    #         # tk.Label(window, text=y).grid(row=x, column=y)          #
    #         #
    #         # # Label 直接按的外部占的空间     横:padx     纵:pady
    #         # tk.Label(window, text=y).grid(row=x, column=y, padx=10, pady=10)
    #
    #         # Label 直接按的内部占的空间     横:ipadx     纵:ipady
    #         tk.Label(window, text=y).grid(row=x, column=y, ipadx=10, ipady=5)
    #
    # window.mainloop()
    
    
    
    
    
    # ------------------------------------------------分割线-------------------------------------------------
    '''
    # ------------------------------------------------------------
    # # 3、Label 之 place 具体位置
    # ------------------------------------------------------------
    '''
    # import tkinter as tk
    #
    # window = tk.Tk()
    # window.title('class12_pack_grid_place 放置位置')
    # window.geometry('400x300')
    #
    # # 设置标签的锚点是 左上角方向,即 nw
    # tk.Label(window, text='place text').place(x=200, y=150, anchor='nw')
    #
    # window.mainloop()
    

      


    其中的部分运行效果图(程序见序号1):

  • 相关阅读:
    docker 打包镜像并传输
    bytes函数——字节
    python——多线程
    Golang基础——随机数rand.Seed
    Golang基础——数据类型:数组
    property 和 setter 装饰器
    qrc文件使用
    SQL优化——索引
    mysql结构及存储引擎
    css样式重置以及定位
  • 原文地址:https://www.cnblogs.com/jyfootprint/p/9568162.html
Copyright © 2020-2023  润新知