20,180,129 weeks of Learning Python notes "Install, view working directory,"

Source: Internet
Author: User

One, the installation process to select more than one Add item, avoid setting environment variables.

Second, the Pyautogui module controls the mouse.

Image module.

----------------------python How to view and replace a working directory------------------------

  1. First, to view the work path, you need to import the OS package:

    Import OS

  2. To view the default work path commands:

    OS.GETCWD ()

  3. The command to modify the work path is (note the path to use \ \):

    Os.chdir ("d:\\ directory")

  4. In order to compare the working directory changes, I added print to My Code:

  5. View the current work path again:

    OS.GETCWD ()

20,180,129 weeks of Learning Python notes "Install, view working directory,"

Related Article

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.