1.绝对坐标

from tkinter import *

root=Tk()
lb=Label(root,text='hello Place')
lb.place(x=0,y=0,anchor=NW)

root.mainloop()

2.相对坐标

from tkinter import *

root=Tk()
lb=Label(root,text='hello Place')
lb.place(relx=0.5,rely=0.5,anchor=CENTER)

root.mainloop()

3.用in来指定放置的容器

from tkinter import *

root=Tk()
bt1=Button(root,text='hello Place',fg='red')
lb=Label(root,text='hello Place',bg='green')
lb.place(relx=0.5,rely=0.5,anchor=CENTER)
bt2=Button(root,text='button in root',fg='yellow')
bt2.place(anchor=W)
bt1.place(in_=lb,anchor=W)

root.mainloop()

4.绑定事件

bind

 

Python3 Tkinter-Place的更多相关文章

  1. python3+tkinter实现的黑白棋,代码完整 100%能运行

    今天分享给大家的是采用Python3+tkinter制作而成的小项目--黑白棋 tkinter是Python内置的图形化模块,简单易用,一般的小型UI程序可以快速用它实现,具体的tkinter相关知识 ...

  2. python3 tkinter添加图片和文本

    在前面一篇文章基础上,使用tkinter添加图片和文本.在开始之前,我们需要安装Pillow图片库. 一.Pillow的安装 1.方法一:需要下载exe文件,根据下面图片下载和安装       下载完 ...

  3. python3 tkinter模块

    一.tkinter 1.tkinter--tool kit interface工具包接口,用于GUI(Graphical User Interface)用户图形界面, 2.python3.x把Tkin ...

  4. Python3 tkinter基础 TK title 设置窗体的标题

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  5. Python3 tkinter基础 Tk quit 点击按钮退出窗体

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  6. Python3 tkinter基础 Text image 文本框中插入图片

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  7. Python3 tkinter基础 Text window 文本框中插入按钮

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  8. Python3 tkinter基础 Scrollbar pack 创建靠右、充满Y轴的垂直滚动条

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  9. Python3 tkinter基础 Spinbox 可输入 能调整的 从指定范围内选择参数的控件

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  10. Python3 tkinter基础 Scale orient 横竖 resolution单步步长 length 长度 tickinterval 指示刻度

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

随机推荐

  1. DB数据源之SpringBoot+MyBatis踏坑过程(五)手动使用Hikari连接池

    DB数据源之SpringBoot+MyBatis踏坑过程(五)手动使用Hikari连接池 liuyuhang原创,未经允许禁止转载  系列目录连接 DB数据源之SpringBoot+Mybatis踏坑 ...

  2. parsing XML document from class path resource [applicationtext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationtext.xml] cannot be opened because it does not e

    控制台异常: parsing XML document from class path resource [applicationtext.xml]; nested exception is java ...

  3. 05JavaScript语句

    1.JavaScript 语句 JavaScript 语句是发给浏览器的命令. 这些命令的作用是告诉浏览器要做的事情. 2.分号 ; 分号用于分隔 JavaScript 语句. 通常我们在每条可执行的 ...

  4. Eclipse报The default workspace'xxxxx' is in use or cannot be created Pl

    原因:出现这种情况一般是workspace的配置文件中出现了.lock文件(workspace/.metadata/.lock),锁定了workspace.把.lock文件删除即可.如果该文件不能删除 ...

  5. 「PHP」简单工厂模式

    引言   所属:创建型模式,常用设计模式之一 工厂模式分为:简单工厂模式.工厂方法模式.静态工厂模式.抽象工厂模式. 下面为简单工厂模式.   参考资料: <大话设计模式>程杰   模式概 ...

  6. 『Python基础-4』字符串

    # 『Python基础-4』字符串 目录 1.什么是字符串 2.修改字符串 2.1 修改字符串大小 2.2 合并(拼接)字符串 2.3 使用乘号'*'来实现字符串的叠加效果. 2.4 在字符串中添加空 ...

  7. ggplot2画简单的heatmap

    gg_heatmap gg_heatmap PeRl ggplot2 heatmap 偶然的机会,发现ggplot2画的heatmap也挺好看的,除了不能画出聚类树来(手动滑稽). 随意新建了两个矩阵 ...

  8. 修改注册表删除Windows资源管理器 “通过QQ发送” 右键菜单项

    运行regedit 展开至:HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers 删除QQShellExt项

  9. 2017Noip普及组游记

    Day0 一天都基本在休息,早上信心赛,大家都是400整. 下午一群人窝在教室里打三国杀. Day1:Before Contest 早上大约十点到了试场,在考提高组,不能进. 喝了一杯咖啡去除早起的身 ...

  10. java 中的线程池和线程 调用小demo

    public class Main { public static void main(String[] args) { try { /// ThreadPoolExecutor executor = ...