import tkinter
from tkinter import ttk # 导入内部包 li = ['王记', '', '男']
root = tkinter.Tk()
root.title('测试')
tree = ttk.Treeview(root, columns=['', '', ''], show='headings')
tree.column('', width=100, anchor='center')
tree.column('', width=100, anchor='center')
tree.column('', width=100, anchor='center')
tree.heading('', text='姓名')
tree.heading('', text='学号')
tree.heading('', text='性别')
tree.insert('', 'end', values=li)
tree.grid() def delButton(tree):
x = tree.get_children()
for item in x:
tree.delete(item) delButton(tree) root.mainloop()

python清空tree.insert()的更多相关文章

  1. python的append insert extend pop del remove使用

    对于 python 数组的操作,有插入和删除,下面介绍各个函数的功能: 插入 插入的函数有 append.insert .extend append append(i) 是在数组的末尾插入一个元素 i ...

  2. python性能分析——insert()

    我们在list中插入数据时,经常使用这两个函数: append():在列表的末尾增加一个数据 insert():在某个特定位置前加一个数据 Python内的list实现是通过数组实现的,而不是链表的形 ...

  3. [Leetcode][Python]35: Search Insert Position

    # -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 35: Search Insert Positionhttps://oj.le ...

  4. appium+python 清空文本框EditText的值

    清空EditText的自动化脚本编写流程: 前提条件:进入到要删除文本框的页面 1.查找到要删除的文本框,可通过id.name等属性进行查找 2.点击 3.通过get_attribute(" ...

  5. python中的insert

    insert()往列表的指定位置添加元素,举个例子: 1 a = ["hello", "world", "dlrb"] 2 a.insert ...

  6. python清空列表的方法

    1.大数据量的list,要进行局部元素删除,尽量避免用del随机删除,非常影响性能,如果删除量很大,不如直接新建list,然后用下面的方法释放清空旧list. 2.对于一般性数据量超大的list,快速 ...

  7. python 清空文件夹

    #!/usr/bin/env python# -*- coding:utf-8 -*-import os def del_file(path): for i in os.listdir(path): ...

  8. python 清空list的几种方法

    本文介绍清空list的四种方法,以及 list=[ ] 和 list.clear() 在使用中的区别(坑). 1.使用clear()方法 lists = [1, 2, 1, 1, 5] lists.c ...

  9. python 清空列表

    # lst = ["篮球","排球","乒乓球","足球","电子竞技","台球" ...

随机推荐

  1. 分层架构web容器的配置安全

    转自:http://hi.baidu.com/shineo__o/item/7520d54c24d234c71081da82 /ps:本以为这是一个偶然配置失误造成的问题,但最近几天无聊时测试发现,有 ...

  2. EVB-P6UL:一识庐山真面目

    前言 原创文章,转载引用务必注明链接.水平有限,如有疏漏,欢迎指正. 本文使用Markdown写成,为获得更好的阅读体验与正确的图片链接显示,请访问我的博客原文: 在爱板网上看到这个活动,昨晚确认,今 ...

  3. vue2.0 watch 详解

    vue官网解释: 一个对象,键是需要观察的表达式,值是对应回调函数.值也可以是方法名,或者包含选项的对象.Vue 实例将会在实例化时调用 $watch(),遍历 watch 对象的每一个属性. 也就是 ...

  4. 两个栈来实现一个队列的C++代码

    利用两个栈来实现一个队列, 这个问题非经常见.  最关键的是要有好的思路, 至于实现, 那是非常easy的事情了. 在本文中, 也想说说自己的思路, 可是. 我认为用代码来表述思路更符合我的习惯. 也 ...

  5. Html5 meta 笔记

    摘抄:原文地址:http://www.kmapk.com/html/help/02/127.html 一.天猫 <title>天猫触屏版</title> <meta co ...

  6. caffe-ubuntu1604-gtx850m-i7-4710hq----bvlc_reference_caffenet.caffemodel

    bvlc_reference_caffenet.caffemodel --- name: BAIR/BVLC CaffeNet Model caffemodel: bvlc_reference_caf ...

  7. Spring里通过注解开启事物

    方式1 <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://w ...

  8. React系列之--props属性

    版权声明:本文为博主原创文章,未经博主允许不得转载. PS:转载请注明出处作者:TigerChain地址:http://www.jianshu.com/p/fa81cebac3ef本文出自TigerC ...

  9. JavaScript -- JavaScript DOM 编程艺术(第2版)

    /* 渐进增强 平稳退化 网页 结构层(structural layer): HTML 表示层(presentation layer): CSS <link rel="styleshe ...

  10. ubuntu 12.10 笔记

    笔记 more ec_unitouch.log |grep Thread-4 筛选日志 打开命令行终端 ctrl + alt + t     查看版本号 : sudo lsb_release -a t ...