Raspberry Pi_Eng_23.5.2 Getting Started of Python


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


23.5.2  Gettting Started

 

The best way to learn Python for the first time is through Python IDLE. Python IDLE can be used in window or terminal environments.

 

23.5.2.1    Starting in the Desktop GUI environment

 

You can start Python using the desktop or Applications Menu.

 

Menu [Python 2] allows you to use the integrated development environment for Python version 2. If you choose menu [Python 3], you can use the integrated development environment for Python version 3.

Python in the applications menu

 

When the program starts, the following Python Shell screen appears, which is a work screen for creating and running the program.


Figure 23‑7 Python Shell screen

 

However, it is inconvenient to develop a large number of programs because the shell is supposed to input commands one line at a time, and it executes immediately after inputting. So, if you select menu File à New Window, a new empty screen is opened, and there, you can execute a large number of programs in bulk or save the whole contents as a file and use it again later.


Figure 23‑8 Python batch window 

 


 

23.5.2.2    Working in Terminal Environment

 

On Terminal screen, you can use Python 2 IDLE by running "python" command, and use Python 3 IDLE by running "python3".

 

When starting on Terminal screen, the following screen appears.


Figure 23‑9 Python in terminal