首页 > 解决方案 > 如何解决python中的Tkinter问题?

问题描述

当我尝试在 python 中使用 python 或 tkinter 制作 youtube 下载器时遇到问题。

代码是:

path_style=ttk.Style
path_style.configure("PT.TButton",background="DarkOrange1",foreground="DarkOrange1", font = ("bahnschrift SewiBold",10))   

错误是:

Traceback (most recent call last):
  File "C:\Users\baraa\PycharmProjects\pythonProject1\folder\baraa.py", line 33, in <module>
    path_style.configure("PT.TButton",background="DarkOrange1",foreground="DarkOrange1",
TypeError: configure() missing 1 required positional argument: 'style'

标签: pythontkinter

解决方案


您是否尝试过使用括号实例化样式类:

path_style=ttk.Style()

推荐阅读