Python – GUI (Label and Textbox)

In this tutorial, I will be demonstrating Graphical User Interface
Programming using Python.

The codes are below:

gui1

 

Our output should be the same as below:

gui2

 

 

Explanation:

 

The lines:

top = Tk()

top.mainloop()

– are used to initialize the form

 

The lines:

L1 = Label(top, text=”First Name”)

L1.pack( side = LEFT)

-used to initialize and position the Label to the left with a caption of First Name

 

The lines:

E1 = Entry(top, bd =5)

E1.pack(side = RIGHT)

-used to initialize and position the text box to the right.

 

Thank you very much for reading this post.

Don’t forget to leave a comment or suggestion. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s