zoukankan      html  css  js  c++  java
  • 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):

  • 相关阅读:
    c#多线程
    [2017.02.05] 阅读《Efficient C++》思维导图
    [2017.02.04] C++学习记录(1)
    [2017.01.04] 经典排序算法思想及其实现
    [2017.01.04] 2017 新年展望
    [151225] Python3 实现最大堆、堆排序,解决TopK问题
    [160111] Python学习记录
    [151116 记录] 使用Python3.5爬取豆瓣电影Top250
    151111 sqlite3数据库学习
    20141127 测试使用Word2013书写博客(代码高亮+公式支持)。
  • 原文地址:https://www.cnblogs.com/jyfootprint/p/9568162.html
Copyright © 2011-2022 走看看