Follow these steps:
Import tkinter module is the same as importing any other module.
import tkinter # In Python 3.x import Tkinter # In python 2.x. (Note Capital T)
The tkinter.ttk module provides access to the Tk theme widget set introduced in Tk 8.5. If Python was not compiled with Tk 8.5, this module can be accessed if Tile was installed. The first method using Tk 8.5 provides additional benefits including rendering antialiased font in X11 and window transparency.
tkinter.ttk — If possible, separate the code that implements the behavior of the widget from the code that implements its appearance. tkinter.ttk is used to create modern GUI applications that cannot be implemented by tkinter itself.
Code # 1 : Create a button using Tkinter.
Output: st rong>
Create a button without using ok em> theme widget.
Create a button using the theme widget tk (tkinter.ttk). It will give you modern graphics effects. The effects will change from one OS to another because it`s mainly for the look.
Code # 2:
| t r> |
Note: look in the output of both codes, BORDER is not present in the 2nd output because
tkinter.ttk does not support border. In addition, when you
ttk.Button mouse cursor over both buttons, the
ttk.Button button changes color and turns light blue (effects can change from one OS to another) because it supports modern graphics, while in the case of a simple button it will not change color since it does not support modern graphics.
Computer Age Statistical Inference: Algorithms, Evidence, and Data Science (Institute of Mathematical Statistics Monographs, Series Number 6). The twenty-first century has seen a breathtaking expan...
Automate the Boring Stuff with Python PDF, 2nd Edition: Practical Programming for Total Beginners Illustrated Edition. The second edition of this Python bestseller (over 100,000 copies sold in prin...
Learning Correct Cryptography by Example. The interconnected world of the current era has drastically changed everything, including banking, entertainment, and even statecraft. Despite difference...
Python for Programmers: with Big Data and Artificial Intelligence Case Studies This book, written for programmers with a high-level experience in another language, uses how-to instructions to teach...