python中对齐问题,python中的Tkinter grid()对齐问题

这篇博客探讨了在Python的Tkinter库中遇到的Grid布局对齐问题。作者展示了如何通过设置grid属性和使用grid_rowconfigure、grid_columnconfigure来解决标签在网格中不正确对齐的问题,并提供了一个修正后的代码示例。
摘要由CSDN通过智能技术生成

I have been working in python for the first time and basically I am trying to get these to labels to align in the correct columns and the correct row but for some reason it doesn't move down rows and the columns are not correct either. Any help would be much appreciated!

CODE:

from tkinter import *

import sys

#Setup GUI

#Create main window

main = Tk();

#Create title of main window

main.title = "Waterizer 1.0";

#Create default size of main window

main.geometry("1024x768");

#Lets get a fram to stick the data in we plan on using

mainApp = Frame(main);

#Snap to grid

mainApp.grid();

#Font for main labels

labelFont = ('times', 20, 'bold');

#Label for the Power

powerLabel = Label(mainApp, text=&

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值