PyCharm initial setup
aims
- Restore the original setting of PyCharm
- The first time you start PyCharm
- Create a Python project
- Set the font PyCharm
- PyCharm upgrades and other
PyCharm's official website address is: https://www.jetbrains.com/pycharm/
01. restore the original setting of PyCharm
PyCharm
The configuration information is stored in the user's home directory in the .PyCharmxxxx.x
directory, and xxxx.x
represents the currently used PyCharm
version number
To restore the PyCharm
initial setting can be performed according to the following steps:
-
- Close running
PyCharm
- Close running
-
- Execute the following command in the terminal end, delete
PyCharm
the configuration directory:
- Execute the following command in the terminal end, delete
$ rm -r ~/.PyCharm2016.3
-
- Restart
PyCharm
- Restart
02. The first time you start PyCharm
- Import Configuration Information
- Select License Agreement
- The initial configuration interface
2.1 Import Configuration Information
- In the first start
PyCharm
, it will first prompt the user whether to import configuration information before - If this is the first time, just click the OK button
2.2 Select License agreement
- PyCharm is a paid software, the purchase price is 199 $ / year or 19.90 $ / month
- But PyCharm provides a version of the free use of students and teachers
- Download address is: https://www.jetbrains.com/pycharm-edu/download/#section=linux
- Commercial versions will be prompted to enter your registration information, or choose a free evaluation
2.3 PyCharm initial configuration interface
- In the initial configuration interface, by
Editor colors and fonts
selecting the editor color scheme
2.4 Welcome Screen
- After the basic configuration of all the work, you can see
PyCharm
the welcome screen , and through the Welcome screen you can begin to develop a Python project
03. Create / Open a Python project
3.1 Project
- Development project is to develop a special function to solve a complex business software
- Usually every project will have a separate dedicated directory for storing all project-related documents
- A project usually contains several files
3.2 Open Python project
- Click on Open button and browse to the previously saved directory Python file , either open the project
- After opening, will create a new directory in a
.idea
directory for storing information related to the project , such as: interpreter version , the project contains files etc. - The first time you open the project, need to wait
PyCharm
for the project initial setup
Interpreter version used project settings
- If not by the open directory
PyCharm
project directory created, sometimes the interpreter version is usedPython 2.x
, you need to set up a separate version of the interpreter - Via File / Settings ... to open the setup window, as shown below:
3.3 New Project
1) naming convention
-
After the project name in front of all to figures , with the knowledge point increments number is incremented
- For example: 01_Python basis , 02_ branch , 03_ cycle ...
-
Under each project file names are in a
hm_xx_知识点
way to name- Where xx is a number of drill file
-
note
-
- Use only recommended when naming the file name in lowercase letters , numbers and underscore
-
- File names can not start with a number
-
-
By the Welcome screen or menu File / New Project can create a new project
2) Step drills
- New
01_Python基础
project, using Python 3.x interpreter - Under the new project
hm_01_hello.py
Python file - Write
print("Hello Python")
the code
04. Set the font PyCharm
05. PyCharm upgrades and other
PyCharm provides a version of the free use of students and teachers
- Education Edition Download: https://www.jetbrains.com/pycharm-edu/download/#section=linux
- Pro Download: https://www.jetbrains.com/pycharm/download/#section=linux
5.1 Installation and start-up procedure
-
- The following command terminal, decompress the downloaded installation package
$ tar -zxvf pycharm-professional-2017.1.3.tar.gz
-
- The directory is moved to the decompressed
/opt
directory, other users can easily
- The directory is moved to the decompressed
/opt
Directory user to store additional installation of software host
$ sudo mv pycharm-2017.1.3/ /opt/
-
- Switching the working directory
$ cd /opt/pycharm-2017.1.3/bin
-
- start up
PyCharm
- start up
$ ./pycharm.sh
5.2 Professional Edition startup icon set
- In the Professional Edition , select the menu Tools / the Create Desktop ... the Entry can be set to start taskbar icon
- Note: When setting the icon, you need to check
Create the entry for all users
- Note: When setting the icon, you need to check
Before uninstalling version 5.3 of PyCharm
1) installation
-
- Program files directory
- The installation package is decompressed and moves to
/opt
the directory - All the files are saved in uncompressed directory
-
- Profile directory
- Start
PyCharm
later, will create a user's home directory in the.PyCharmxxx
hidden directory - Save
PyCharm
configuration information
-
- Shortcut file
/usr/share/applications/jetbrains-pycharm.desktop
In
ubuntu
the application starts shortcuts are usually stored in/usr/share/applications
the directory
2) Uninstall
-
To uninstall
PyCharm
only need to do the following two steps: -
- Delete unzipped directory
$ sudo rm -r /opt/pycharm-2016.3.1/
-
- Under Delete home directory hidden directory for saving the configuration information
$ rm -r ~/.PyCharm2016.3/
If you no longer need to use PyCharm
/usr/share/applications/
underjetbrains-pycharm.desktop
deleted
5.4 Education Edition installation walkthrough
# 1. 解压缩下载后的安装包
$ tar -zxvf pycharm-edu-3.5.1.tar.gz
# 2. 将解压缩后的目录移动到 `/opt` 目录下,可以方便其他用户使用
$ sudo mv pycharm-edu-3.5.1/ /opt/
# 3. 启动 `PyCharm`
/opt/pycharm-edu-3.5.1/bin/pycharm.sh
Follow-up courses are using the Professional version walkthrough
Set the startup icon
-
- Edit shortcut file
$ sudo gedit /usr/share/applications/jetbrains-pycharm.desktop
-
- In accordance with the following contents modify files, you need to pay attention to specify the correct
pycharm
directory
- In accordance with the following contents modify files, you need to pay attention to specify the correct
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm
Icon=/opt/pycharm-edu-3.5.1/bin/pycharm.png
Exec="/opt/pycharm-edu-3.5.1/bin/pycharm.sh" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm