본문 바로가기

Principe/Coding

Python Basics

Beautifulsoup4 설치

C:\Users\solat>pip install beautifulsoup4
Collecting beautifulsoup4
  Downloading https://files.pythonhosted.org/packages/66/25/ff030e2437265616a1e9b25ccc864e0371a0bc3adb7c5a404fd661c6f4f6/beautifulsoup4-4.9.1-py3-none-any.whl (115kB)
     |████████████████████████████████| 122kB 819kB/s
Collecting soupsieve>1.2 (from beautifulsoup4)
  Downloading https://files.pythonhosted.org/packages/6f/8f/457f4a5390eeae1cc3aeab89deb7724c965be841ffca6cfca9197482e470/soupsieve-2.0.1-py3-none-any.whl
Installing collected packages: soupsieve, beautifulsoup4
Successfully installed beautifulsoup4-4.9.1 soupsieve-2.0.1

업데이트 설치

C:\Users\solat>python -m pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
     |████████████████████████████████| 1.5MB 819kB/s
Installing collected packages: pip
Successfully installed pip-20.1.1

연산자

# 실수/정수 계산
>>> 4 / 2
2.0
>>> int(2.0)
2
>>> int(5/2)
2
>>> int('2')
2
>>> float(2)
2.0

# //: 버림 나눗셈(floor division) 연산자
>>> 5 // 2
2

# %: 모듈로(modulo) 연산자
>>> 5 % 2
1

# **: 거듭제곱 연산자
>>> 2 ** 10
1024