Mainly for the (cross-platform) Python GUI frontend options.
CEF (Chromium Embedded Framework). Pro: can use the same way of MVC thinking (modern html5); build-in chromium browser. Con: someone said it may need a little c++. PyQt (v5). Pro: big community, good doc (for c++). Con: c++ way of thinking, just the language is py (the official GUI tutorial lacks GUI screenshots!); pay for commercial usage; still often needs c++. Tkinter. Pro: build-in w/ py, big community.
...
As the pyhon-docx does not want to provide a documentation (except some APIs) and the API doc web is really hard to browse and read, here are some small tips/demo tutorials to remember/avoid pits and falls.
Please note:
lib (0.8) provides only basic functions mainly for adding something (seems to be for test purpose). The main actions we do in a docx file should be done using MS API via this lib.
...
Two methods of downloading & converting pictures/images to a combined pdf file with parallel (multi-thread) from Mark Needham.
f.write(img2pdf.convert(…)) [ref MarkHNeedham]
from PIL import Image [ref DataToFish]
Note: fpdf is not suggested as it canNOT support jpg natively. [ref stackoverflow]
Books & Docs
#
Seaborn tutorial & gallary OReilly 2017 - [easy to find common examples] Python Data Science Handbook Packt 2015 - [nice code grammar] Python Data Visualization Cookbook, 2nd Ed. (Igor Milovanovic) Packt 2015 - [rich & various content] Mastering Python Data Visualization Packt 2015 - [advanced nice plots & deployments] Mastering matplotlib (D.M. McGreggor) [Very bad composition] Packt 2018 - Matplotlib for Python Developers - 2nd Ed (by Allen Yu, Claire Chung) Overview of Libs
#
Python Data Visualisation Landscape
...
See also:
LearnPython, the Language Pandas
#
Get column_nr in pandas/numpy.
if isinstance(X, pd.DataFrame): X_is_df = True row_nr = X.shape[0] column_nr = X.shape[1] if isinstance(X.columns, pd.core.index.MultiIndex): df_columns_is_multi_index = True else: df_columns_is_multi_index = False else: # non-DF X_is_df = False row_nr = np.shape(X)[0] column_nr = np.shape(X)[1] use dataframe directly against spark
#
lib Optimus
from optimus import Optimus op = Optimus(master="local") df = op.create.df(<some data>) ... Sourcing/Importing
#
execfile or os.system
#
execute the other python file in place:
...
execfile or os.system
#
execute the other python file in place:
execfile("/path/to/my/lib/mylib.py") or:
import os os.system("python /path/to/my/lib/mylib.py") import
#
import sys import os sys.path.append(os.path.abspath("/path/to/my/lib")) import mylib ref
#
See other methods here.
A great 5-video tutorial: 35minutes on YouTube (6 tomatoes / 2.5 hours for non-stop studing by coding). Author’s Github (py2), My Github (py3).
Differences in my Github code:
py3, not py2 using on_put() to test validity of input json from client using on_delete() to test params (just to test, should NOT be used in real-world) using another route /test2?x=1&y=3 to test params Usage in Nix:
pip3 install falcon gunicorn gunicorn app:api # in the folder of app.
...
Related:
Learn Django python desktop GUI/frontend py code cookbook/reuse plot in py w pyvis Python in Win by MS official tutorial CN 用 Rust 让 numpy、scikit 和 pandas 加速 100 倍!开源 Weld 技术揭秘 PRE-INSTALL: CONDA VS. PIP
#
Pip requires apt. Thus, pip+apt. Pip chose to live together with apt (or other package manager) as apt is better at managing packages, especially when related to system. Some pip packages requires system (apt) to cooperate, such as uwsgi, graphviz, ffmpeg, gcc, python3-dev.
...
(updated 2021.1)
Related:
Learn Python
Ref: This is a combined learning note of:
basic level sentdex’s youtube tutorial 2016, the corresponding video+text one is here. official tutorial which is still too complicated for new users, so better to use that after following this blog. middle level another tutorial: Django Tutorials for Beginners 2016 book “O’Reilly 2014 - Test-Driven Development with Python (django 1.7)”. official docs: DOCs.DjangoProject.com. all-in-one 3.8-hour video. Python Django Web Framework - Full Course for Beginners 2018 w/ Code (in sublime).
...
INSTALL
#
Anaconda Way
#
This is suggested for very new users to use a stable environment.
It is NOT suitable for normal users / experienced programmers / engineers.
for windows
#
Download Python 3 from Anaconda and install.
From Windows “Start” menu, run “Jupyter” directly. (at least since v5.3.1)
Old versions needs to run from navigator as below:
anaconda for linux
#
Similar to win, for details, see here.
...