Python Learning Note 02

Source: Internet
Author: User

Python's Static grammar check

Python is a dynamic language. There is no strict type restriction when passing parameters to Python.

When writing a Python program, it is often found that errors can only be found at execution time. There are some errors due to hidden deep, only the specific logic will trigger, often resulting in the need to spend a lot of time to get the syntax errors to slowly troubleshoot. In fact, there are some errors are very obvious, if you can write a program to find these errors, you can improve work efficiency. Recently I found that you can use the Pyflakes program to check the syntax of the python syntax so that you can find errors as early as possible.

There are three ways to use Pyflakes, the first is to use as a command line tool, the second can be used as a vim plugin in the Vim editor to achieve WYSIWYG, and the third can be used in Emacs.

Pyflakes:

Cd/usr/src

wget https://pypi.python.org/packages/5b/b7/dcd6ebc826065ca4ccd2406aac4378e1df6eb91124625d45d520219932a1/ PYFLAKES-1.5.0.TAR.GZ#MD5=84A99F05E5409F8196325DDA3F5A1B9A

Tar XF pyflakes-1.5.0.tar.gz

Installation:

CD pyflakes-1.5.0/

Python setup.py Install


Setting up environment variables

Ln-sv/usr/local/python2.7/bin/pyflakes/usr/bin/pyflakes


Grammar check:

#pyflakes nslookup.py




Resources:

Http://www.cnblogs.com/berlin-sun/p/pyflakes.html

Https://pypi.python.org/pypi/pyflakes









This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1942474

Python Learning Note 02

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.