[Python] 纯文本查看 复制代码 import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="matplotlib")
from tkinter import Tk, Text, Button, LEFT
def show_multiplication_table():
table = ""
for i in range(1, 10):
row = ""
for j in range(1, i+1):
result = i * j
equation = f"{j}*{i}={result}\t"
row += equation
table += row + "\n"
text_box.delete("1.0", "end")
text_box.insert("end", table)
window = Tk()
window.title("Python 版 99乘法表")
text_box = Text(window, height=15, width=70)
text_box.pack()
button = Button(window, text="9*9口诀表", command=show_multiplication_table, width=30, height=2)
button.pack()
window.mainloop()
python版9*9口诀表,源码直接回复可见,简单易懂!
|