常用的第三方模块
Python既有内建模块,还有大量的第三方模块,模块网址按需安装
PIL
全称是: Python Imaging Library 是Python的图像处理标准库,功能强大且易用,仅支持到Python 2.7
Pillow
支持最新Python3.X
安装方式: pip install pillow
操作缩放图像:
|
|
图片模糊:
|
|
virtualenv
为Python应用提供不同的独立的Python运行环境,以适应不同版本
安装方法: pip install virtualenv
windows环境下的使用:
打开命令提示符,可以指定位置,使用 python -m venv 文件名 就可以创建一个独立的干净的没有第三方库的Python运行环境.
在此环境下使用pip安装其他库,就会安装在新创建的环境中,
图像界面
Tkinter
官方解释:
The tkinter package (“Tk interface”) is the standard Python interface to the Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, as well as on Windows systems. (Tk itself is not part of Python; it is maintained at ActiveState.) You can check that tkinter is properly installed on your system by running python -m tkinter from the command line; this should open a window demonstrating a simple Tk interface.
可以看出,tkinter是Tk 图形库的一个标准Python接口,既可以在Unix平台上,也可以在Windows平台上运行,Tk它本身并不是Python的一部分,还在维护.可以在命令行窗口直接输入 python -m tkinter 就会弹出一个窗口.
Hello World窗口示例:
|
|
点击一下,可以在命令行里输出”hi there,everyone!”