Programming

[Python3] installation – tarball

python packages: https://www.python.org/ftp/python/ I tried install Python-3.6.4  tarball on RHEL6 and RHEL7, looks no problem. Install pre-required packages $ sudo yum install openssl openssl-devel -y Install python3 by tarball $ wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz $ tar -xJf Python-3.6.4.tar.xz $ cd Python-3.6.4 ############## # enable ssl module ############## $ vi Modules/Setup  <= un-comment the following lines # …

Programming

[Python] Print Formatting

>>> name = ‘Lego Chen’ >>> job = ‘engineer’ >>> print ‘%s is an %s’ %(name, job) Lego Chen is an engineer >>> print ‘%10s is an %20s’ %(name, job) Lego Chen is an engineer >>> print ‘The flotting number is: %10.3f’ %(1000.33356) The flotting number is: 1000.334 >>> print …

jupyter

[Python] Jupyter Server Setup

Purpose: I’d like to setup a jupyter sever that only can be edited by me and I also can share the jupyter notebooks to anyone. There are two URLs, one for admin (me) and another for share to anyone. Admin: https://jupyter-admin.chenlego.me Share(guest): https://jupyter.chenlego.me But, current jupyter server doesn’t support permission management for …

Programming

[Python][Basic] Basic Types

Types Numbers http://nbviewer.jupyter.org/github/jmportilla/Complete-Python-Bootcamp/blob/master/Numbers.ipynb cast int(1.5) => 1 float(1) => 1.0 Difference Python2 vs Python3 In Python 2, the / symbol performs what is known as “classic” division, this means that the decimal points are truncated (cut off). 3/2 => 1 In Python 3 however, a single / performs “true” division. …