Python学习笔记(十八)PIL图像处理和Tkinter图形界面

这篇博客介绍了Python中PIL库的使用,包括安装步骤和常见问题。同时,讲解了Python自带的Tkinter库创建图形界面的基础操作,强调了引用PIL模块的正确方式和Tkinter的便捷性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考资料:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00140767171357714f87a053a824ffd811d98a83b58ec13000

https://www.cnblogs.com/xianyue/p/6588869.html

https://blog.youkuaiyun.com/tianxiawuzhei/article/details/44922843

https://blog.youkuaiyun.com/sinat_25704999/article/details/50118465

1、除了内建的模块外,Python还有大量的第三方模块。基本上,所有的第三方模块都会在PyPI - the Python Package Index上注册,只要找到对应的模块名字,即可用easy_install或者pip安装。

2、PIL是常用的第三方模块之一,全称Python Imaging Library,已经是Python平台事实上的图像处理标准库了。Window系统下使用PIL前需要作如下准备工作:

(1)从官网下载PIL安装包:http://pythonware.com/products/pil/
(2)安装时会提示在注册表中找不到Python2.7,可运行下面的python程序将Python2.7安装信息写入注册表。

#  
# script to register Python 2.0 or later for use with win32all  
# and other extensions that require Python registry settings  
#  
# written by Joakim Loew for Secret Labs AB / PythonWare  
#  
# source:  
# http://www.pythonware.com/products/works/articles/regpy20.htm  
#  
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html  
   
import sys  
   
from _winreg import *  
   
# tweak as necessary  
version = sys.version[:3]  
installpath = sys.prefix  
   
regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)  
installkey = "InstallPath"  
pythonkey
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值