[Dark Horse] net course notes PyCharm initial setup -Ubuntu environment

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

PyCharmThe configuration information is stored in the user's home directory in the .PyCharmxxxx.xdirectory, and xxxx.xrepresents the currently used PyCharmversion number

To restore the PyCharminitial setting can be performed according to the following steps:

    1. Close running PyCharm
    1. Execute the following command in the terminal end, delete PyCharmthe configuration directory:
$ rm -r ~/.PyCharm2016.3
    1. Restart PyCharm

02. The first time you start PyCharm

  1. Import Configuration Information
  2. Select License Agreement
  3. 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
  • 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 fontsselecting the editor color scheme

2.4 Welcome Screen

  • After the basic configuration of all the work, you can see PyCharmthe 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 .ideadirectory 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 PyCharmfor the project initial setup

Interpreter version used project settings

  • If not by the open directory PyCharmproject directory created, sometimes the interpreter version is used Python 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

      1. Use only recommended when naming the file name in lowercase letters , numbers and underscore
      1. 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.pyPython 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

5.1 Installation and start-up procedure

    1. The following command terminal, decompress the downloaded installation package
$ tar -zxvf pycharm-professional-2017.1.3.tar.gz
    1. The directory is moved to the decompressed /optdirectory, other users can easily

/opt Directory user to store additional installation of software host

$ sudo mv pycharm-2017.1.3/ /opt/
    1. Switching the working directory
$ cd /opt/pycharm-2017.1.3/bin
    1. start up PyCharm
$ ./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

Before uninstalling version 5.3 of PyCharm

1) installation

    1. Program files directory
    • The installation package is decompressed and moves to /optthe directory
    • All the files are saved in uncompressed directory
    1. Profile directory
    • Start PyCharmlater, will create a user's home directory in the .PyCharmxxxhidden directory
    • Save PyCharmconfiguration information
    1. Shortcut file
    • /usr/share/applications/jetbrains-pycharm.desktop

In ubuntuthe application starts shortcuts are usually stored in /usr/share/applicationsthe directory

2) Uninstall

  • To uninstall PyCharmonly need to do the following two steps:

    1. Delete unzipped directory
$ sudo rm -r /opt/pycharm-2016.3.1/
    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/under jetbrains-pycharm.desktopdeleted

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

    1. Edit shortcut file
$ sudo gedit /usr/share/applications/jetbrains-pycharm.desktop
    1. In accordance with the following contents modify files, you need to pay attention to specify the correct pycharmdirectory
[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

Guess you like

Origin blog.csdn.net/qq_23090489/article/details/92985728
Recommended