Skip to content

Instantly share code, notes, and snippets.

View Duiesel's full-sized avatar
:octocat:

Alan Mo Duiesel

:octocat:
  • Armenia
View GitHub Profile
@Duiesel
Duiesel / cmd_autocomplete.py
Last active June 18, 2019 13:59 — forked from ikautak/cmd_test.py
Python/Python3 cmd module with autocomplete filenames sample.
#!/usr/bin/env python
import cmd
import os
class MyCmd(cmd.Cmd):
def __init__(self):
cmd.Cmd.__init__(self)
self.prompt = '(MyCmd)'
@Duiesel
Duiesel / python_decorator_guide.md
Created June 4, 2021 02:46 — forked from Zearin/python_decorator_guide.md
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].