writing_python_scripts/quickref.tex
author Amit Sethi
Tue, 09 Nov 2010 15:40:53 +0530
changeset 418 8a42b4203f6d
parent 335 d5248a15274c
permissions -rw-r--r--
"Merging heads"

See where python searches for modules:\\
{\ex \lstinline|    sys.path|}

Include our own path in PYTHONPATH:\\
{\ex \lstinline|    sys.path.append(our_path)|}

Run certian code only if executed and not if imported:\\
{\ex \lstinline|    if __name__=="__main__": #do something|}