Skip to content

Instantly share code, notes, and snippets.

View rmssoares's full-sized avatar

Ricardo Soares rmssoares

View GitHub Profile
@kms70847
kms70847 / MakingFilesImportableAnywhere.txt
Last active December 17, 2019 18:34
The Simplest Possible Way To Make A Python File Into A Package That's Importable From Anywhere
The Simplest Possible Way To Make A Python File Into A Package That's Importable From Anywhere
~~~ A Guide For (And By) the Incurably Befuddled ~~~
==============================================================================================
SCENARIO: while writing a one-shot project, you construct a module named LovelyCoconut.py.
#main.py
import LovelyCoconut
LovelyCoconut.bang_halves_together()
@Zearin
Zearin / python_decorator_guide.md
Last active May 10, 2024 14:26
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].