Python Usage Basics (WIN10)

Source: Internet
Author: User

1. Installation

Official website Download: https://www.python.org/

Please select 2. X version

2. Open python from the command prompt

Just enter Python directly and click Enter

View Python version input python-v

WIN10 Open a command prompt: Win+x then press A, where Win+x is the System shortcut menu, right-click Win is also the System shortcut menu.

Set Environment variables (add environment variables that tells the operating system where to specify the path of an EXE):

Right-click win Select control Panel → top right category select ' big icon ' → system → advanced system settings → bottom right corner of environment variable → new → variable name fill python→ variable value fill path → OK

3. Exit Python at the command prompt

CTRL + Z

4. Editor Selection

The official website downloads the integrated development environment idle

Do not select Notepad, cannot be highlighted in syntax, cannot be indented

Use Vim or emacs under Linux

5. Integrated development environment New source file in idle

CTRL + N

6. Running the source file

Ctrl+f5

7. Run the source file at the command prompt

Enter CD space + the parent path where the file is located

Enter Python space + file name

8. The first two characters of the source file are #! , followed by a program. This line tells your Linux/unix system which interpreter to run when you execute your program

  #!/usr/bin/python

  #

Any content that is to the right of the # symbol is a comment

9. Get Help information

Use the Help () function

Example: Getting help with str: Assist (STR)

Special case: Get help with Roll-out print: Assist (' print ')

    

Python Usage Basics (WIN10)

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.