我制作了一个非常简单的程序,并尝试将其导出到应用程序文件中。我目前正在使用 Python 3.6 和 py2app 将 py 文件转换为 app。 所以我创建了设置文件:
from setuptools import setup
OPTIONS = {'iconfile':'sc.icns',}
setup(
app = ['hello.py'],
options = {
'py2app': OPTIONS},
setup_requires = ['py2app']
)
然后在终端中输入:
python3 hello_setup.py py2app
几秒钟后,它创建了 dist 文件夹,其中有 hello.app,问题是当我运行它时,它会出现一个显示“hello error”的窗口,然后我打开.exec 文件在应用程序中查看终端并显示此错误:
ValueError: character U+6573552f is not in range [U+0000; U+10ffff]
为什么会出现?我如何解决它?非常感谢。
如果需要,这里是'hello.py'的代码
from tkinter import *
from tkinter import messagebox
root = Tk()
def printworld():
messagebox.showinfo('Hello', 'Hello World')
button1 = Button(root, text='Press me!', command=printworld)
button1.pack()
root.mainloop()
最佳答案
关于python-3.x - ValueError : character U+6573552f. .. Py2aap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45493029/