Python : python3 install and cheat sheet

python

install python3

sudo pacman -S python

upgrade pip

sudo pip install --upgrade pip

python = python3

※ Not required for Arch linux

In the environment where python2 is pre-installed (Ubuntu or CentOS), it will be [python = python2]. Change to [python = python3].

nano ~/.bashrc

or vim ~/.bashrc or micro ~/.bashrc

~/.bashrc

alias python="python3" 
alias pip="pip3"

source ~/.bashrc

Reflect the settings

python version check

python -V

Python 3.x.x

python IDLE execution

python

2 * 44

Calculation

print('hello python')

Output hello python

Finished IDLE

Ctrl + d

or

exit()

Execution method .py file

touch hello.py

micro hello.py

How to install micro editor

print('hello world')

python hello.py

hello world

thank you

Thank you for watching until the end. I'm glad if you can use it as a reference.

Thank you for Helping

Give money to us for Amazon gift

We will continue to update useful information. I am delighted to jump to your help. Thank you very much.