Windows下Python 3.2的PIL或替代方案?

3
我正在编写我的第一个Python程序 :) 但是,我安装了Python 3.2而不是2.7,因为新版本包含了TkInter。现在我找不到在其中使用PIL的方法。
我阅读了this question,但作为一个完全的新手,这对我没有什么帮助。我安装了zlib和libjpeg,但在构建pil-py3k时无法进一步操作。我不知道我应该在这里做什么:
# --------------------------------------------------------------------
# Library pointers.
#
# Use None to look for the libraries in well-known library locations.
# Use a string to specify a single directory, for both the library and
# the include files.  Use a tuple to specify separate directories:
# (libpath, includepath).  Examples:
#
# JPEG_ROOT = "/home/libraries/jpeg-6b"
# TIFF_ROOT = "/opt/tiff/lib", "/opt/tiff/include"
#
# If you have "lib" and "include" directories under a common parent,
# you can use the "libinclude" helper:
#
# TIFF_ROOT = libinclude("/opt/tiff")

FREETYPE_ROOT = None
JPEG_ROOT = None
TIFF_ROOT = None
ZLIB_ROOT = None
TCL_ROOT = None

有没有更简单的方法为Python 3启用带有PNG和JPEG支持的PIL?

一个选项是下载旧版本的Python,但那样就没有TkInter了?

我希望你能理解我是个新手,所以如果我问了一些愚蠢的问题,请原谅。Python看起来真的很酷!;) 感谢任何帮助。


5
请查看这些非官方软件包,它们应该可以在py3k上运行。 - Paolo Moretti
此外,tkinter也随Python 2.7一起提供,http://docs.python.org/library/tkinter.html,只是组织/命名方式不同。 - agf
4个回答

8

5

0

0

正如agf在您的问题评论中提到的那样,tkinter已经包含在Python的每个版本中多年了。重要的区别是tkinter包的重构。其中最大的变化是基本包名称:在Python 3.x中,tkinter包的名称为tkinter,而在Python 2.x中,该包的名称为Tkinter(请注意大写字母"T")。您可以查看Python 2.7.2 docs上有关tkinter的更多信息。

不幸的是,我没有在Python 3.x中使用过PIL,因此无法提供任何帮助,但希望您可以在2.7中完成所需的工作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接