PyCharm is often used when using Python language for web development. PyCharm is a Python IDE created by JetBrains, and the refactoring plug-in Resharper of VS2010 comes from JetBrains. At the same time it supports Google App Engine, and PyCharm supports IronPython. These features, supported by advanced code analysis programs, make PyCharm a powerful tool for Python professional developers and starters.
1. Go to the official website of PyCharm to download the tool
. 2. Download the Python parser: Python 2.7.8, and configure the Python path environment variable.
2.1) There are many versions of Python , the most commonly used is Python2.7.x, and the latest version in July 2020 is Python 3.8.3.
Python2.7.8 download address:
https://www.python.org/downloads/release/python-278/
If you want to download other versions of Python, please change the suffix /python-xxxx/ of the website to the corresponding version number, such as /python-273/, /python-2711/, /python-383/, as follows:
https://www.python.org/downloads/release /python-273/
https://www.python.org/downloads/ release /python-2711/
https://www.python.org/downloads/release /python-383/
2.2) Configure the Python environment variable path
path to the installation path of Python on your computer. For example, if your Python2.7.x is installed on G drive, Then path = G:\Python27; The
specific configuration is as follows:
Right-click [My Computer]-"Properties-"Advanced Environment Settings-"Environment Variables -" Find the path in [System Variables], the configuration is as follows:
path = G:\Python27;
As shown in Figure 1:
python -V
as shown in picture 2:
3. Open PyCharm and set the style and font size of the software.
Style: Windows, Font: Consolas, Font
Size: 16 Click [File] —> Settings —> Appearance —> Theme: Windows, Name: Consolas ,Size: 16 on the toolbar, as shown in Figure (3):
//Python2 version code
#-*- coding: UTF-8 -*-
import sys
type = sys.getfilesystemencoding()
mystr = "my string"
print(mystr)
print "Hello world"
a = "I am"
b = " a student"
##连接两个字符串a和b
c = a+b
biao = '--两个字符串相连: a+b = '
##将utf-8转换为本地字符串
print biao.decode('utf-8').encode(type)
print c
//Python3 version code
#-*- coding: UTF-8 -*-
import sys
type = sys.getfilesystemencoding()
mystr = "my string"
print(mystr)
print("Hello world")
a = "I am"
b = " a student"
##连接两个字符串a和b
c = a+b
biao = '--两个字符串相连: a+b = '
##将utf-8转换为本地字符串
print(biao.encode(type).decode('utf-8'))
print(c)
Click run on the toolbar, the effect is as follows: