Python Learning Note-day6-"SYS module, how to import a module"

Source: Internet
Author: User

Record the usage of the SYS module and look at things that are easy to forget, but easily forgotten.

One, sys module

1, the common use method

2. How to import python files from other modules

3. Import the Python module in the same directory

4. Two ways to import

5. Put the module you want to import into any directory in the python environment variable, but it's too cumbersome.

6, add the directory of the import module to the Python environment variable, you can

Ii. usage of SYS.ARGV

1, SYS.ARGV significance

2, to determine the legitimacy of the parameters executed from the command line, sample code

Python Learning Note-day6-"SYS module, how to import a module"

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: 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.