This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple generator wrapper, not sure if it's good for anything at all. | |
# With basic python threading | |
from threading import Thread | |
try: | |
from queue import Queue | |
except ImportError: | |
from Queue import Queue | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Beginners .vimrc | |
" v0.1 2012-10-22 Philip Thrasher | |
" | |
" Important things for beginners: | |
" * Start out small... Don't jam your vimrc full of things you're not ready to | |
" immediately use. | |
" * Read other people's vimrc's. | |
" * Use a plugin manager for christ's sake! (I highly recommend vundle) | |
" * Spend time configuring your editor... It's important. Its the tool you | |
" spend 8 hours a day crafting your reputation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import code | |
def get_module_docstring(filepath): | |
"Get module-level docstring of Python module at filepath, e.g. 'path/to/file.py'." | |
co = compile(open(filepath).read(), filepath, 'exec') | |
if co.co_consts and isinstance(co.co_consts[0], basestring): | |
docstring = co.co_consts[0] | |
else: | |
docstring = None | |
return docstring |