I like Python, but I don't know much because I don't have much time to write. Pyhton3 seems to be interesting soon, so I decided to write it outside of work and prepared an environment.
There is a tool called pyenv, so install it with homebrew.
version control
$ brew install pyenv
#Find out which version can be installed
$ pyenv install -l
#Install your favorite version
#It takes time to make cup ramen(Experience)
$ pyenv install 3.5.1
$ pyenv install 3.4.4
$ pyenv versions
* system (set by /Users/cc/.pyenv/version)
3.4.4
3.5.1
#If global is specified, that version will be used system-wide.
$ pyenv global 3.4.4
#If you specify local.python_A file called version is created
#Use that version under the directory where this file is located
$ pyenv local 3.4.4
$ pyenv versions
system
* 3.4.4 (set by /Users/cc/.pyenv/version)
3.5.1
Other sites have written how to use pyenv-virtualenv, but I don't recommend it because it gets complicated.
Assuming virtualenv, it is the system default that is returned by which python.
Speaking of Python, it's virtualenv! That's why we create an execution environment with virtualenv.
Execution environment construction
$ pip install virtualenv
$ cd /path/to/develop
$ virtualenv example
$ cd example
$ . bin/activate
(example) $
It's too easy. Python is the best!
Let's use PySide, a Python binding for Qt, a multi-platform GUI library.
PySide installation
(example) $ brew install qt
(example) $ cd /path/to/develop/example
#I'm just watching it on YouTube, which is long:)
#PySide is Python 3.It seems that it only supports up to 4(Python3.5 not supported)
(example) $ pip install -U PySide
(example) $ python
Python 3.4.4 (default, Mar 5 2016, 20:17:44)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySide
>>> from PySide import QtGui #OK if there is no error so far
>>>
I looked at various sites, but didn't say which one was better. It's hard to do both, so either one is better ~ The execution speed of Electron was mentioned, but it's a 2015 article. Please let me know if this is good!
Recommended Posts