[Python] Chapter 01-02 About Python (Execution and installation of development environment)

[01-02] Execution and installation of development environment

Last time I gave an overview of Python. This time, I will explain how to write a program in Python and execute it.

We will also explain how to install the development environment (PyCharm) used when developing Python.

About two program execution methods

There are two ways to run Python:

--How to use the interactive command line (interpreter format) as if you were entering a command --How to write a program and execute it (we will do it in the next section)

I would like to talk about each of them, but since "how to write a program and execute it" is implemented by preparing a development environment, we will discuss that later.

How to use the command line

Let's start with how to use the interactive command line. Please click the URL below.

https://www.python.org/

Then the following screen will appear. 1.png

Then click on the red frame below.

2.png

Then, after a while, the following screen will be displayed. 3.png

In the above, the part where ">>> ■ </ font>" is called ** Python prompt **, and the Python instruction, that is, the program code is executed and input there. I will continue to do it.

The screen for inputting and executing with the keyboard is also called the console.

Now, let's write the program. Write "print ('Hello world!')" At the prompt.

4.png

After inputting, press the [Enter] key. Then you can see that it is executed as follows.

5.png

Simply put, print is a function, which means that the value in parentheses () of the function is printed to the console.

In addition, Japanese can be used (double-byte characters) in the print function as follows. 6.png

In addition to outputting character strings, you can also perform simple numerical calculations. 7.png

The above is the execution method using the console.

Install PyCharm

To do this, you first need to download PyCharm, a Python integrated development environment tool, at the following site:

This section describes how to download and install the tool.

First, click the link below. https://www.jetbrains.com/ja-jp/PyCharm/download/

Then, the following screen will be displayed, so click the [Download] button on the Community side.

  • Professional version is charged, but there is no problem with the community version of the Python development environment explained this time.
8.png

Execute the downloaded executable file below. 9.png

Then, the following display will appear, so click [Next]. 10.png

If you want to specify the save location, click [Browse ...] and specify the location. If you don't mind the above, just click [Next]. 11.png

If you want to create a shortcut on your desktop, check the following points and click [Next]. 12.png

Just press [Install] to install. 13.png 14.png

When the installation is complete, the following screen will appear, so click [Finish]. 15.png

This completes the PyCharm installation.

Launch PyCharm

Finally, start PyCharm. The first time you start it, you will see a screen asking for your consent. When agreeing, check the following points and click [Continue]. 16.png

Then choose whether to send stats for your development environment to JetBrains or receive improvements from JetBrains. In that case, click [Send Anonymous Statistics] below. 17.png

From the next time, the following PyCharm will be launched. 18.png

For the first time only, select black background or white background and click [Next: Featured plugins]. (Here, we will proceed with a black background.) 19.png

Just press [Start using PyCharm]. 20.png

Then, the following screen will appear. Select [Create New Project]. 21.png

Specify the work location of your program. This time, create a folder called ** python ** on the desktop and use that as the work location. After specifying, click [Create]. 22.png

Then, Python will be installed as shown below. (First time only) 7.png

Then the latest information on Python in the development environment will come out. If you want to skip it, press [X]. 23.png

Now we have described how to install and start PyCharm.

Finally

This time, I ran it from the console and checked the result. We also installed PyCharm, which is a development environment. Next time, I would like to explain how to write a program and execute it using PyCharm.

Return to [Table of Contents Link]

Recommended Posts

[Python] Chapter 01-02 About Python (Execution and installation of development environment)
About Python development environment
Installation of Python3 and Flask [Environment construction summary]
python development environment -use of pyenv and virtualenv-
Environment construction of python and opencv
Installation of SciPy and matplotlib (Python)
Installation of Visual studio code and installation of python
Construction of Python local development environment Part 1 (pyenv, pyenv-virtualenv, pip installation)
About the virtual environment of python version 3.7
About errors during PyInstaller installation and execution
Prepare the execution environment of Python3 with Docker
[Python of Hikari-] Chapter 08-04 Module (Installation of external library)
[Python] Chapter 02-01 Basics of Python programs (operations and variables)
About shallow and deep copies of Python / Ruby
Continuation of multi-platform development with Electron and Python
Comparison of Python and Ruby (Environment / Grammar / Literal)
Unification of Python environment
Python development environment construction
Installation of Python 3.3 rc1
python2.7 development environment construction
Development environment in Python
[Python] Chapter 01-01 About Python (First Python)
Installation of matplotlib (Python 3.3.2)
[Python of Hikari-] Chapter 06-02 Function (argument and return value 1)
Build a GVim-based Python development environment on Windows 10 (1) Installation
Python development environment construction 2020 [From Python installation to poetry introduction]
Reproduce the execution example of Chapter 4 of Hajipata in Python
Manage Python runtime packages and development environment packages with Poetry
python memo (for myself): About the development environment virtualenv
Reproduce the execution example of Chapter 5 of Hajipata in Python
About python objects and classes
About Python variables and objects
About the ease of Python
Python installation and basic grammar
About various encodings of Python 3
About Python, len () and randint ()
Organize your Python development environment
About Python datetime and timezone
Python environment construction and TensorFlow
[ev3dev × Python] Build ev3dev development environment
About Python and regular expressions
[For organizing] Python development environment
About the features of Python
About Python and os operations
Python (Python 3.7.7) installation and basic grammar
Python # About reference and copy
About Python sort () and reverse ()
[Python of Hikari-] Chapter 08-03 Module (Import and use of standard library)
Unify the environment of the Python development team starting with Poetry
Pros and cons of converting Django's development environment to Docker
Construction of Python local development environment Part 2 (pyenv-virtualenv, pip usage)
[Python of Hikari-] Chapter 05-10 Control syntax (interruption and continuation of iteration)
[Python] PyCharm environment settings (installation, interpreter settings, addition of packages) Mac environment
[Tips] Problems and solutions in the development of python + kivy
Overview of Python virtual environment and how to create it
Python environment construction and SQL execution example to DB and memo of basic processing for statistics 2019
The story of Python and the story of NaN
Explanation and implementation of PRML Chapter 4
About installing Pwntools and Python2 series
Build and test a CI environment for multiple versions of Python
Example of building python development environment on windows (wsl2, vscode, pipenv)