The final code for this step should look like this: from tkinter import * Similarly, we add the textbox and the speak button by adding the following code to the script after the code for label and just before root.mainloop() speech_entry = Entry(root,įont=('calibre',10,'normal')).place(relx=0.5,rely=0.3,anchor=CENTER)Ĭommand = make_speech).place(relx=0.5,rely=0.5,anchor=CENTER) Finally, we place the label at a relative position (0.5, 0.1) using. ![]() Here, text and font are attributes which the Label() object needs in order to create the label on the window. Here, are defining a Label object that will be displayed on the window saying "Enter text: ", we bind it to the root.i.e.our main window. Add the following code to the script just before root.mainloop() label = Label(root,įont= ('Helvetica 15 bold')).place(relx=0.5,rely=0.1,anchor=CENTER) ![]() Now, lets make our application look useful by adding some content.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |