Python language learning 4--using a text editor

Source: Internet
Author: User
Tags sublime text sublime text editor

In Python's interactive command line to write programs, the advantage is that you can get results, the disadvantage is unable to save, the next time you want to run, you have to knock again.

So, in the actual development, we always use a text editor to write code, finished, saved as a file, so that the program can be run repeatedly.

Download a text editor, can not use the Windows bring Notepad and Word can, so save not plain text files, will add some of their own code or something, error

: http://www.sublimetext.com/

Enter a small program in the sublime text editor

Saved under a directory (where the location is stored under the E-Disk Python folder)

The suffix of the file name to be saved is. py

And then run

See similar C:\> command-line mode that is provided in Windows:

In command-line mode, you can execute python into the Python interactive environment or python hello.py run a .py file.

In a python interactive environment, only Python code can be entered and executed immediately.

In addition, running files in command-line mode differs from running .py python code directly in a python interactive environment. The python interactive environment automatically prints out the results of each line of Python code, but running the Python code directly does not.

Python language learning 4--using a text editor

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.