3

Can anyone explain to me how to import the Python colors? This is for a programming assignment, but I'm stuck here and can't find tutorials online.

I tried from livewires import games, color

File "/Users/username/Desktop/Programming100/PhysicsLab/PhysicsCsLab.py", line 2, in <module>
ImportError: No module named livewires

I wanted to color shapes such as ellipse, rect, etc., but I don't know how that can be made possible.

Edit: I don't know if this matters or not, but I'm using CALICO.

4

3 回答 3

4

这只是意味着您尚未安装该软件包。或者你已经安装了它,但是你正在使用运行脚本的 python 解释器没有安装它。pip当特别为一个 python 解释器定义时,通常会发生这种情况。

如果您还没有安装它,那么您可以使用:

pip install livewires

如果这没有帮助,您将进入口译员的位置,进入Scripts然后使用pip install livewires.

于 2013-11-29T18:36:54.293 回答
2

您没有名为livewires. 您可以像这样通过pip安装它pip install livewires

于 2013-11-29T18:36:55.493 回答
1

你是说终端颜色吗?您可以尝试 colorma - https://pypi.python.org/pypi/colorama,效果很好!我不确定你将如何绘制形状。您可以尝试使用诅咒 - http://docs.python.org/2/library/curses.html

于 2013-11-29T18:38:23.190 回答