Steps for installing Python code

Source: Internet
Author: User

Before giving you a detailed introduction to the Python code, let's take a look at the Python code coverage statistics Tool coverage. py, and then give a full introduction to the Python code. The following is a detailed description of the relevant issues. I hope you can use it later.

Use easy-install to install:

 
 
  1. easy_install coverage  

After installation, a coverage.exe file is installed in c: \ Python25 \ Scripts. This exe can basically complete all the functions we need. Run it. If you find that the module is missing, install

 
 
  1. easy_install。  
  2.  
  3. Coverage Command Line   
  4.  

The key parameters are as follows:

1. run

To execute code coverage rate statistics, you only need to run the Statistical Code through the coverage run parameter.

After running, a coverage statistical result file is automatically generated. coverage. If you want to modify the default file name, you only need to set the COVERAGE_FILE environment variable.

2. report

With the coverage rate statistical result file, you only need to run the report parameter to view the statistical result in the command.

 
 
  1. $ coverage report  
  2. Name Stmts Exec Cover  
  3. ---------------------------------------------  
  4. my_program 20 16 80%  
  5. my_module 15 13 86%  
  6. my_other_module 56 50 89%  
  7. ---------------------------------------------  
  8. TOTAL 91 79 87%  

3. html

The most handsome and cool function is to generate the html test report directly.

 
 
  1. $ coverage report  
  2. Name Stmts Exec Cover  
  3. ---------------------------------------------  
  4. my_program 20 16 80%  
  5. my_module 15 13 86%  
  6. my_other_module 56 50 89%  
  7. ---------------------------------------------  
  8. TOTAL 91 79 87%  
  9.  

The above article describes how to install Python code. I hope you will get the information you want.

  1. Three application solutions in Python logic operations
  2. Effect of Python environment Initialization
  3. Python string operation manual in practice
  4. Find your own voice in the game using the Python script
  5. How to Implement Python in C

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.