python - 如何解决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'
解决方案
您是否尝试过使用括号实例化样式类:
path_style=ttk.Style()
推荐阅读
- uwp - UWP Win2D以指定宽度绘制文本?可能吗?
- python - 使用 python 的 SimpleHTTPServer 运行一个简单的服务器
- c# - 将请求类类型传递给请求的类构造函数
- php - $MetaTags(false) 变量打破页面 (SilverStripe 3.7.1)
- java - Java多协议设计结构
- google-apps-script - 如何从过滤器中自动选择范围而无需手动输入?
- python - Python 'ser.write' 在 Windows 上永久停止程序,可能的错误?
- c# - 起订量设置方法
- validation - 站点密钥的 Google reCAPTCHA v2 无效域
- javascript - JavaScript如何从第二个包含的一个数组中删除元素