/usr/lib/python3.10/tkinter/__init__.py:839: UserWarning: Glyph 20154 (\N{CJK UNIFIED IDEOGRAPH-4EBA}) missing from current font. func(*args) /usr/lib/python3.10/tkinter/__init__.py:839: UserWarning: Glyph 35780 (\N{CJK UNIFIED IDEOGRAPH-8BC4}) missing from current font. func(*args) /usr/lib/python3.10/tkinter/__init__.py:839: UserWarning: Glyph 20215 (\N{CJK UNIFIED IDEOGRAPH-4EF7}) missing from current font. func(*args)
时间: 2024-01-10 20:02:49 浏览: 36
这个警告是因为在当前字体中找不到指定的中文字符,分别是“人”、“评”和“货”字。这可能会导致在使用这些字符时无法正确显示,但一般情况下不会影响程序的功能。
你可以尝试更换字体,或者在代码中指定字体来解决这个问题。比如,在创建应用程序的时候,可以通过设置`font`参数来指定字体:
```python
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="你好,世界!", font=("Arial", 12))
label.pack()
root.mainloop()
```
这里将标签的字体设置为Arial,大小为12。你可以根据需要选择其他字体和大小。
相关问题
/usr/lib/python3.10/tkinter/__init__.py:839: UserWarning: Glyph 35780 (\N{CJK UNIFIED IDEOGRAPH-8BC4}) missing from current font. func(*args) /usr/lib/python3.10/tkinter/__init__.py:839: UserWarning: Glyph 20215 (\N{CJK UNIFIED IDEOGRAPH-4EF7}) missing from current font. func(*args)
这个警告是因为在当前字体中找不到指定的中文字符,分别是“评”和“货”字。这可能会导致在使用这些字符时无法正确显示,但一般情况下不会影响程序的功能。
你可以尝试更换字体,或者在代码中指定字体来解决这个问题。比如,在创建应用程序的时候,可以通过设置`font`参数来指定字体:
```python
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="你好,世界!", font=("Arial", 12))
label.pack()
root.mainloop()
```
这里将标签的字体设置为Arial,大小为12。你可以根据需要选择其他字体和大小。
ImportError: cannot import name Mapping from collections (/usr/lib/python3.10/collections/__init__.py)
这个错误通常是因为你的代码中导入了 `collections.Mapping`,但是 `Mapping` 在 Python 3.10 中已经被移除了。如果你使用的是旧版本的代码,可能需要更新你的代码以适应最新的 Python 版本。
如果你需要使用类似 `Mapping` 的功能,可以考虑使用 `collections.abc.Mapping`。它是一个抽象基类,提供了 `Mapping` 的大部分功能,并且在 Python 3.10 中仍然可用。
你可以这样导入 `collections.abc.Mapping`:
```
from collections.abc import Mapping
```
然后使用 `Mapping` 来代替 `collections.Mapping`。
如果你只是想简单地使用一个字典对象,那么直接使用 `dict` 就可以了。