【发布时间】:2019-03-16 02:51:28
【问题描述】:
我最近在学习pythondialog。我尝试从这里运行示例代码:http://pythondialog.sourceforge.net/#installation
这是代码:
#! /usr/bin/env python3
import locale
from dialog import Dialog
locale.setlocale(locale.LC_ALL, '')
d = Dialog(dialog="dialog")
d.set_background_title("My little program")
if d.yesno("Are you REALLY sure you want to see this?") == d.OK:
d.msgbox("You have been warned...")
code, tags = d.checklist("What sandwich toppings do you like?",
choices=[("Catsup", "", False),
("Mustard", "", False),
("Pesto", "", False),
("Mayonnaise", "", True),
("Horse radish","", True),
("Sun-dried tomatoes", "", True)],
title="Do you prefer ham or spam?",
backtitle="And now, for something "
"completely different...")
if code == d.OK:
pass
else:
code, tag = d.menu("OK, then you have two options:",
choices=[("(1)", "Leave this fascinating example"),
("(2)", "Leave this fascinating example")])
if code == d.OK:
pass
它可以在linux--debian下工作,当我使用“apt install python3-dialog”时。如果我只pip install 'pythondialog',程序错误:'ExecutableNotFound...'
现在我正在尝试使用pycharm在windows10下运行代码,但出现同样的错误:
...
File "D:\PycharmProjects\test\venv\lib\site-packages\dialog.py", line 469, in _path_to_executable
"can't find the executable for the dialog-like "
dialog.ExecutableNotFound: Executable not found: can't find the executable for the dialog-like program
我想我似乎安装了关于 dialog() 的“exe”,但我不知道该怎么做。 我在网上找了很久。但是没有用。请帮助或尝试提供一些想法如何实现这一目标。
提前致谢。
【问题讨论】:
-
请将代码放入pastebin而不是显示在图片中。