
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Use Unicode and Special Characters in Tkinter
Sometimes we need to add unicode and special charset in our Tkinter application. We can add unicode characters in our labels or widgets concatenating the signature as, u ‘/<Unicode of Character>’. You can find the list of all unicode characters from here
In this example, we will add a unicode character in the button widget.
Example
# Import the required Libraries from tkinter import * #Create an instance of tkinter frame win= Tk() win.geometry("700x200") #Create a button Button(win, text='Click'+u'\u01CF', font=('Poppins bold', 10)).pack(pady=20) #Keep running the window or frame win.mainloop()
Output
Running the above code will create a button with a unicode character (u01CF).
Advertisements