Calculator for Resistor Values

Calculator for 4 rings 1. Ring 2. Ring 3. Ring 4. Ring Value Tolerance brownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegoldsilver brownredgreenbluepurplegoldsilver 0Ω 0% Calculator for 5 rings 1. Ring 2. Ring 3. Ring 4. Ring 5. Ring Value Tolerance brownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegoldsilver brownredgreenbluepurplegoldsilver 0Ω 0%

Minimal REST API with Flask

From the flask release notes: Returning a dict from a view function will produce a JSON response. This makes it even easier to get started building an API. To get a minimal REST-Api all you have to do is: from flask import Flask app = Flask(__name__) @app.route(‘/return_dict’, methods=[‘GET’]) def return_dict(): return {“x”: “1”} if __name__…

Overcoming PyInstaller Pitfalls

When using PyInstaller to package an application to a self-containing bundle you might run into some pitfalls: Pitfall 1: PyInstaller overwrites spec file The first time you run pyinstaller you run it with pyi-makespec my_module.py instead of pyinstaller my_module.py pyi-makespec will generate a my_module.spec which you can alter. Afterwards you just ran pyinstaller my_module.spec to…

Visualizing Python dependencies with pipdeptree

Let’s say you have a project with the following top level dependencies: xlrd money babel pyinstaller jinja2 pywin32 After installing them you have the following packages: altgraph==0.16.1 Babel==2.7.0 beautifulsoup4==4.7.1 et-xmlfile==1.0.1 future==0.17.1 jdcal==1.4.1 Jinja2==2.10.1 macholib==1.11 MarkupSafe==1.1.1 money==1.3.0 pefile==2019.4.18 pipdeptree==0.13.2 psutil==5.6.3 PyInstaller==3.4 pytz==2019.1 pywin32==224 pywin32-ctypes==0.2.0 soupsieve==1.9.2 xlrd==1.2.0 With pipdeptree you get a tree with the sub-depdencies to…