Python – GUI (Grid Layout)

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

The codes are below:

 

gui2

 

 

Our output should be the same as below:

 

gui1

 

 

Explanation:

 

These lines:

Label(master, text=”Name:”).grid(row=0)
Label(master, text=”Age:”).grid(row=1)

– one way of declaring one or more labels and giving them their position in the grid

While these lines:

E1 = Entry(master)
E2 = Entry(master)

E1.grid(row=0, column=1)
E2.grid(row=1, column=1)

-another way of declaring one or more textboxes then giving their position in separate lines.

 

Thank you 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