Skip to content

Instantly share code, notes, and snippets.

View Duiesel's full-sized avatar
:octocat:

Alan Mo Duiesel

:octocat:
  • Armenia
View GitHub Profile
#!/usr/bin/python
import sys
import os
import glob
import subprocess
import getopt
def parse_project_option(keys, value, target):
key = keys.pop(0)
@Zearin
Zearin / python_decorator_guide.md
Last active November 6, 2025 16:16
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].

@ikautak
ikautak / cmd_test.py
Created November 21, 2012 14:48
python cmd module and complete sample.
#!/usr/bin/env python
import cmd
import dircache
class MyCmd(cmd.Cmd):
def __init__(self):
cmd.Cmd.__init__(self)
self.prompt = '(MyCmd)'