I. Getting started with Python installation and pycharm

Source: Internet
Author: User
Tags python script

Tag: Image stat enters the latest version. COM source code mode installation Nload

First, install Python

1. Install under Linux

The general system is installed by default 2.6.6 version, upgrade to 2.7 version, but 2.6 can not be deleted, because the system is dependent on it, the Epel source of the latest is also the 2.6 version, so the source code to install the 2.7 version

Login to select the version of Linux to download https://www.python.org/downloads/source/

cd/usr/local/srcwgetHttps//www.python.org/ftp/python/2.7.14/Python-2.7.14.tgzTarZXVF python-2.7. -. TGZCD Python-2.7. -./configure--prefix=/usr/local/ Make&& Make InstallMV/usr/bin/python/usr/bin/python_2.6- OldLN-s/usr/local/bin/python/usr/bin/Pythonpython-V prints out 2.7Version

Yum will not be used after the operation, make the following settings for Yum to use version 2.6

vim/usr/bin/Yum#!/usr/bin/python changed to #!/usr/bin/python2. 6
Upgrade PIP, the default pip call after upgrading Python is 2.6, cannot be used, install the latest version of wget https://bootstrap.pypa.io/get-pip.py python get-pip.py2, Windows installation

Next Complete installation

Verify

Windows + R input cmd

Third, the use of Pycharm

1. Set the Python version of the call

File---Settings---project: Python _code---Project interpreter select the Python path that was installed in the previous step

2. Font settings

3. Set the Python file header

Click: File--Settings--editor--code style--file and code template--python Script Insert the following header

# !/usr/bin/env python # -*-coding:utf-8-*- # @Time    : ${date} ${time}#  @Author  : Lingxiangxiang#  @File    : $ {name}.py

Effect:

4. Pycharm Set Python parameters

5, pycharm common shortcut keys

http://yangfangs.github.io/wiki/pycharm-Shortcut-key/

Ctrl + C    //+ x   //+ v   //+ D   //+ SHIF + N//+ shif + F  //
   
    + mouse key  // 
    forward, back   + ALT + direction 
         left/right + A;  Ctrl + ALT + L   // 
     + Enter   //
    +/    //Line comment/ 
    uncomment       tab+tab   //Indent Backward
   

6. Python Run the program

Linux:chmod +x test.py &&./test.py | | Python test.py

Windows:cmd python test.py

Pycharm: Direct Click to run

7. Pycharm Debug Mode

Breakpoint: The program executes to this place to stop

F7: Enter into the code

F8: Skip to Next step

F9: Restore the program or execute to the next breakpoint

I. Getting started with Python installation and pycharm

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.