PyChecker使用指南
来源:互联网 发布:租车带司机软件 编辑:程序博客网 时间:2024/06/10 06:15
简介
PyChecker是一个对Python源代码进行语法检查的工具。
主页:http://pychecker.sourceforge.net
PyChecker is a static analysis tool for finding bugs in Python source code. It finds problems that are typically caught by a compiler for less dynamic languages, like C and C++. It is similar to lint.
目前最新版本是2008-08-18 更新的pychecker-0.8.18。
安装
前提:本地安装好Python2.x, 推荐2.6版本,虽然2.7版本也发布了。3.0版差异太大,相当于全新版本,不保证兼容性,不推荐使用。
最好将IPython也一并安装了。
下载地址:http://sourceforge.net/projects/pychecker/
从网页上下载pychecker-0.8.18.tar.gz,解压。
然后在pychecker-0.8.18目录(其下有setup.py脚本), 执行命令行python setup.py install 执行安装。这也是在Windows下python软件的通用安装方式。
使用
安装好后,试试在pychecker-0.8.18目录执行命令行pychecker setup.py,检查setup.py的语法
E:/pychecker-0.8.18>pychecker setup.py
E:/pychecker-0.8.18>C:/Python26/python.exe C:/Python26/Lib/site-packages/pychecker/checker.py se
tup.py
Processing module setup (setup.py)...
Warnings...
C:/Python26/lib/distutils/command/bdist_wininst.py:271: Statement appears to have no effect
C:/Python26/lib/distutils/command/build_scripts.py:80: No class attribute (dry_run) found
C:/Python26/lib/distutils/command/build_scripts.py:97: No class attribute (dry_run) found
C:/Python26/lib/distutils/command/build_scripts.py:120: (file) shadows builtin
C:/Python26/lib/distutils/command/build_scripts.py:121: No class attribute (dry_run) found
C:/Python26/lib/distutils/command/install_data.py:62: (dir) shadows builtin
C:/Python26/lib/distutils/command/install_data.py:64: (dir) shadows builtin
C:/Python26/lib/distutils/command/install_data.py:66: (dir) shadows builtin
C:/Python26/lib/distutils/command/install_scripts.py:52: (file) shadows builtin
C:/Python26/lib/distutils/command/install_scripts.py:53: No class attribute (dry_run) found
19 errors suppressed, use -#/--limit to increase the number of errors displayed
这里pychecker 是个bat脚本,实际执行的是C:/Python26/python.exe C:/Python26/Lib/site-packages/pychecker/checker.py 。
这里检查结果将setup.py依赖的文件中语法错误或告警也检查出来了。
如果只想检查setup.py自身的语法,可以用--only参数
E:/pychecker-0.8.18>pychecker --only setup.py
E:/pychecker-0.8.18>C:/Python26/python.exe C:/Python26/Lib/site-packages/pychecker/checker.py --only setup.py
Processing module setup (setup.py)...
Warnings...
None
更多的参数,可以使用pychecker --help查看
- PyChecker使用指南
- pychecker 使用指南
- PyChecker使用指南
- PyChecker使用
- pychecker help
- Pychecker man
- windows下安装使用pychecker
- windows下安装使用pychecker
- python语法检查利器pychecker
- Python代码分析工具:PyChecker、Pylint
- Python代码分析工具:PyChecker、Pylint
- pychecker以及pylint的安装以及使用方法
- Python 代码分析工具:PyChecker、Pylint,简解
- PyChecker 在游戏引擎环境下的使用
- 再谈 PyChecker 在游戏引擎环境下的使用
- GOOGLE使用指南
- Cygwin使用指南
- 使用指南索引
- 关于datagridview里checkbox列事件
- 天下何处不外包,外包何时上正轨
- 基数排序
- 关于各种编码的区别
- Windows核心编程学习笔记 第二部分 完成编程任务 第6章 线程的基本知识
- PyChecker使用指南
- Web Service框架XFire与Tomcat集成
- 线性链表的应用----箱排序和基数排序
- MySQL的FROM_UNIXTIME()和UNIX_TIMESTAMP()区别
- 分配排序
- ClearCase完全攻略(八)UCM实例:一些概念补充分析
- SharePoint 2010 与 Business Intelligence 免费公开课
- ORACLE标准审计
- A lot of things