[Python以終為始] Day 1–安裝, IDE, run python with interpreter prompt
想研究機器學習的前端工程師,從零到一百學習python的筆記
Published in
2 min readSep 5, 2022
Install
Check installation- type python
in cmd
If python had not been installed:
- download and install
1–1. Go to python download(For Mac) and download latest stable release(python 3.10.6)
1–2. Typebrew install python3
at the Terminal prompt - After download, type
python
in cmd and still shows “command cannot found: python” - After researching, type
python3
in cmd and that works fine!!
Choose IDE
I have VS code experience before, so I choose VS code to be my python IDE.
Use Python interpreter prompt to run python
- typing
python3
and pressing[return]
key - Once you have started Python, you should see
>>>
where you can start typing stuff. - type
print("Hello World")
after>>>
, and press[return]
, you will seeHello World
printed to the screen.
>>>
- This is called the Python interpreter prompt.
You are not allowed to quit the interpreter prompt with normal ctrl + c
. You can use ctrl + d
or type exit()
and press [return]
to quit the interpreter prompt.