Some of the Python libraries

Source: Internet
Author: User

1, Os.path

Os.path.split (): OS split path, returns a tuple, the first is a path, the second is a file name;

Os.path.basename (): Get file name only;

Os.path.dirname (): Get path only;

Os.path.splitext (): Separates the path, file name, extension, and returns a tuple;

Os.path.commonprefix: In a set of paths, look for a common prefix;

Os.path.jion (): combine some scattered strings to generate a secure path;

Os.path.expanduser (): Look for the eternal home directory;

Os.path.expandvars (): The value of the environment variable in the reading system;

Note: os.environ[' MY ']= ' VALUE ' adds system environment variables

Os.path.normpath: Handle irregular strings and convert them to normal;

Os.path.abspath: Converts a relative path to an absolute path;

2, cmd

This blog post will be constantly updated!

Some of the Python libraries

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.