파이썬 시작하기( let's start python)

1. 파이썬 특징
코드 실행 할때마다 인터프리터(언어해석기)를 통해 해석 후에 실행.
실행속도가 다소 느리다.
그러나 그 차이가 0.x초 차이라면 체감이 어렵다.
고속 파이썬 라이브러리 : Numpy, Scipy

2. 파이썬 설치하기
http://devopspy.com/python/install-python-3-6-ubuntu-lts/

파이썬 버전확인
[우분투에서]
ctrl+alt+t (터미널 띄우기) -> 명령어 입력

[파이썬 2.x 버전]
python

[파이썬 3.x버전]
python3

[우분투 14.04.2 기준] → 우분투 버전에 따라 실행이 원활하지 않을 수 있으므로 주의

Step 0 – Install the pre-requisites (optional)

The following step are optional, as to cater post-installation issues i.e. “zipimport.ZipImportError: can’t decompress data; zlib not available” for the missing zlib-dev, and also preparing environment for Python development.
$ sudo apt-get update
$ sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
$ sudo apt-get install python3-pip python3-dev

Latest Ubuntu 17.10 already comes with Python 3.6 installed, can verify by executing python3.

For Ubuntu 16.10 and 17.04

Python 3.6 is available for install via the main repository, all you have to do is
$ sudo apt-get update
$ sudo apt-get install python3.6

For Ubuntu 14.04 and 16.04 LTS

Python 3.6 is not available for direct install, you have to either add a repository and install, or simply download and install. You can verify if Python 3.6 is available for direct install
$ apt-cache search python3.6

Method 1 – using PPA

PPA (Personal Package Archives) allows contributor to upload and share Ubuntu source packages to be built and published at an apt repository by Launchpad. There has been always an open debate regarding the PPA red flags while using a PPA, main important point to consider is, who made the PPA. For Python 3.6 J Fernyhough’s PPA, is widely used and reliable.
$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt-get update
$ sudo apt-get install python3.6

Method 2 – Download and configure

$ wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
$ tar -xvf Python-3.6.3.tgz
$ cd Python-3.6.3
$ sudo ./configure --enable-optimizations
If above configure ends up with no errors, execute the following commands to complete the installation of Python 3.6
$ sudo make -j8
$ sudo make install

Verification

Execute the python3.6
nahmed@localhost:~$ python3.6
Python 3.6.3 (default, Oct  6 2017, 08:44:35)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Creating virtualenv using Python 3.6 (optional)

Given that you have more than one Python 3 versions installed, and need to use Python 3.6 for your project. Best practice is to create a virtual environment using Python 3.6

Install virtualenv

$ sudo pip3 install virtualenv

Create virtualenv

$ virtualenv -p /usr/bin/python3.6 ~/virtualenvs/venv_devopspy
$ source virtualenvs/venv_devopspy/bin/activate
(venv_devopspy) nahmed@localhost:~$






3. 파이참 설치하기

https://medium.com/@singh.shreya8/how-to-install-pycharm-in-ubuntu-16-04-ubuntu-14-04-ubuntu-18-04-linux-e






파이썬 시작하기( let's start python) 파이썬 시작하기( let's start python) Reviewed by kukanuc on 2월 14, 2019 Rating: 5

댓글 없음:

Powered by Blogger.