我正在寻找一种方法来正确证明我的字符串。这是我的代码:
from graphics import*
def main():
win = GraphWin("Simple Editor", 600, 400)
win.setCoords(0,0,60,40)
#Text - Filename
s = "File Name:"
s=s.rjust(10)
text1 = Text(Point(10, 35), s)
text1.draw(win)
#Text - Keyword
s1 = "Keyword:"
s1=s1.rjust(8)
text2 = Text(Point(10, 28), s1)
text2.draw(win)
#Text - Replace with
s2 = "Replace with:"
s2=s2.rjust(10)
text2 = Text(Point(10, 21), s2)
text2.draw(win)`
main()
这些.rjust()
命令似乎什么都不是。当我运行程序时,他们仍然将文本集中在我给他们的点上,而不是在那个点上正确证明。我找不到解决这个问题的方法,请帮忙!