Command Line 3

Source: Internet
Author: User

Python Script:

1. Add some lines into a blank file:

echo "Hello World" >> text.txt.

Everytime before create a script file. We have some steps:

A. Create a. script file by using mkdir text.script

  B. Add some lines into the script to make sure the file was allowed to run under the shell:

echo ' if __name__ = = ' __main__ ': \ n Print ("Welcome to a Python script") ' > script.py # Here we're using single B Racket on each side of echo word. Pay attention, that there is four space before print.

    

2. We can use Python2-to-call the script:

  Python text.script

Or use Python3 to the script:

  Python3 Text.script

Here, we can use Python3 or Python2 to the script. But sometimes, if several project want to call a same the library in different version.

3. Why do we want to use virtual environment:

  

If we use virtual environment:

    

    

Command Line 3

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.