Create Your Own TreeView Using Python Tkinter!!

preview_player
Показать описание
In this tutorial I will be showing you how to create a TREEVIEW using Python. This tutorial provides a step-by-step walkthrough made to help you increase your knowledge and understanding of Python.

Order of Video:
00:00 - 02:05 = Introduction and Explanation
02:05 -13:52 = Writing the Code
13:52 - END = Conclusion

Subscribe to my YouTube channel "AnalystRising" for more amazing stuff!!

This channel is about learning to code and analyse data in small bitesize amounts. As a result, larger projects come as a series which I put as a playlist. A link to some of my playlists can be found below.

Create PowerPoint Presentations Only Using Python

Build a Music Player using Python

Learn Regression Modelling from scratch

Basic graphing with Python

Building Network Graphs using Python

PATREON:
If you liked the tutorial then please feel free to make a donation on Patreon.
Just copy and paste the link below to go directly to my page.

The audio sometimes goes a little funny however it is still clear to hear and understand
Apologies for any inconvenience caused by this

I have more videos available on Arduinos and Excel ready for viewing!!

PLEASE NOTE:
My Python Shell may be different to yours and may be set-up in a different way.  Doing various things such as installing packages/modules may be different for you.

#analystrising
#pythontutorial
#tkinter
Рекомендации по теме
Комментарии
Автор

Hi there please take this as constructive feedback your video covers the essential parts very well but the voice is too low even though my laptop's volume is at 100. Either try to switch to light mode of the code editor or write and execute the code on the fly.

All the best!

yastikakumar
Автор

bro, ı have a project and ı dont know this subject. it is a helpful.
thanks

elcorazon
Автор

Interesting, why is the text of "Sublevel 1st Row" automatically indented?

tpz
Автор

FULL SOURCE CODE BELOW:
import tkinter as tkr
import tkinter.ttk as tkrttk

"""CREATE SCREEN"""
screen = tkr.Tk()
screen.geometry("800x200")

"""GETTING TREEVIEW LIST"""
treetime = tkrttk.Treeview(screen)

"""Creating Columns"""
treetime["columns"] = ("Column 2", "Column 3", "Column 4", "Column 5")

#Formatting Columns (minwidth is the minimum column width. stretching is the ability to change the column widths (e.g. stretch=tk.NO)
treetime.column("#0", width=50, minwidth=25)
treetime.column("Column 2", width=50, minwidth=25)
treetime.column("Column 3", width=50, minwidth=25)
treetime.column("Column 4", width=50, minwidth=25)
treetime.column("Column 5", width=50, minwidth=25)

#Defining Column Headings
treetime.heading("#0", text="Column 1", anchor=tkr.W)
treetime.heading("Column 2", text="Column 2", anchor=tkr.W)
treetime.heading("Column 3", text="Column 3", anchor=tkr.W)
treetime.heading("Column 4", text="Column 4", anchor=tkr.W)
treetime.heading("Column 5", text="Column 5", anchor=tkr.W)

#Inserting Rows (Can be done in a multiple levelling format)
#1st Level
Row1 = treetime.insert("", 1, text = "First Row", values = ("B1", "C1", "D1", "E1"))
Row2 = treetime.insert("", 2, text = "Second Row", values = ("B2", "C2", "D2", "E2"))
#2nd Level
treetime.insert(Row1, "end", text = "Sublevel 1st Row", values = ("B1.1", "C1.1", "D1.1", "E1.1"))
treetime.insert(Row1, "end", text = "A1.2", values = ("B1.2", "C1.2", "D1.2", "E1.2"))

"""PACK TREE"""
treetime.pack(side=tkr.TOP, fill=tkr.X)

"""ACTIVATE"""
tkr.mainloop()

AnalystRising
Автор

If I need to connect to an sqlite3.db file then what to do bro. Please answer 😳

elitecoder
Автор

Can you do a tkinter treeview using SQL server database?

roastedpeanuts
join shbcf.ru