Objectives
Understand IDLE.
Be able to run python in interactive mode.
Python development environment
Python development environment
Python development environment
When writing a programme and developing a system, various mechanisms are required, including “a mechanism for writing the programming language”, “a mechanism for running the programme”, “a mechanism for checking the cause of errors” and “a mechanism for finding unintended movements (bugs) in the running programme”. In python as well, these mechanisms are required.
In python, tools (integrated development environment) such as Jupyter and pyCharm are available as a mechanism to do these things. In this article (Python (Part 2) | Python Development Environment and Execution), I will try to input and execute simple python using the integrated development environment called ‘IDLE’, which is included when ‘python’ is installed.
How to start up an IDLE
Click on the Windows Start menu.
Click on ‘All apps’.
Click on the installed ‘python’ directory to expand it. After expansion, click on the ‘IDLE’ that appears.
The ‘IDLE’ is activated.
interactive mode
As mentioned in the previous article on ‘interactive mode’, it refers to a mode in which python is executed as if it were a line-by-line dialogue using an ‘interactive shell (python console)’.
Running python using interactive mode
Once IDLE has been started, run the following program to find the area of a triangle.
Enter ’10’ in the variable ‘height’ and ’10’ in the variable ‘bottom’ and divide the result by 2. (Explanation of variables etc. is given in another issue).
Continue after the symbol >>> and enter “height = 10″.
Continue by entering “bottom = 10” after the new >>>.
Continue by entering “(hegiht * bottom) / 2” after the >> >.
After the last calculation ((hegiht * bottom) / 2), the execution result appears as “50.0” without the “>>>” and the “>>>” appears again on the next line.
That’s all for this time.
ブックマークのすすめ
「ほわほわぶろぐ」を常に検索するのが面倒だという方はブックマークをお勧めします。ブックマークの設定は別記事にて掲載しています。