python知识点
来源:互联网 发布:淘宝联盟提不了现 编辑:程序博客网 时间:2024/05/16 00:44
1、在mac下,安装支持PIL库。
1.1 下载安装Combo Installer libpng & libjpeg: http://ethan.tira-thompson.com/Mac_OS_X_Ports.html
1.2 sudo easy_install pil
测试代码:
!/usr/bin/env python import Imageimport osimport os.pathimport syspath = sys.argv[1]small_path = (path[:-1] if path[-1]=='/' else path) +'_small'if not os.path.exists(small_path): os.mkdir(small_path)for root, dirs, files in os.walk(path): for f in files: fp = os.path.join(root, f) img = Image.open(fp) w, h = img.size img.resize((w/4, h/4)).save(os.path.join(small_path, f), "JPEG") print fp
2. Mac下安装MySQL驱动
参考:http://www.cnblogs.com/ken-zhang/archive/2011/05/14/2046211.html
a. sudo easy_install mysql-python
b. export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
3. Mac安装PyQt
使用brew进行安装
brew install pyqt
若importPyQt4失败,在.bash_profile添加export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
- python知识点
- python 知识点
- Python知识点
- python知识点
- Python 知识点
- Python知识点
- Python知识点
- python知识点
- python 知识点
- Python知识点
- python--知识点
- Python 知识点
- Python知识点
- Python知识点
- Python多线程知识点
- python 的一些知识点
- python知识点讨论
- python知识点汇总
- php unset函数与null区别
- 7阶乘尾数零的个数
- 自我追求
- Delphi学习笔记二——数据类型
- 从抛硬币试验看概率论的基本内容及统计方法
- python知识点
- oracle添加主键自增长
- [Front-end] CSS3 Patterns, Explained
- 告别拖延,过上高效生活
- css 样式小结
- OC 单例模式
- 弟子规
- 日文中中国一年里的常用语
- 【Redhat】静态ip设置