Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created June 8, 2013 18:34
Show Gist options
  • Save Eugeny/5736155 to your computer and use it in GitHub Desktop.
Save Eugeny/5736155 to your computer and use it in GitHub Desktop.
eugeny@eugeny-thinkpad ~/tmp/b> find ..
..
../a
../a/__init__.py
../a/__init__.pyc
../b
../b/__init__.pyc
../b/script.py
../p.pyc
eugeny@eugeny-thinkpad ~/tmp/b> find .. | grep -v pyc
..
../a
../a/__init__.py
../b
../b/script.py
eugeny@eugeny-thinkpad ~/tmp/b> cat ../a/__init__.py
def foo():
pass
print 'a imported'
eugeny@eugeny-thinkpad ~/tmp/b> cat script.py
import imp
a = imp.load_source('a', '../a/__init__.py')
eugeny@eugeny-thinkpad ~/tmp/b> python script.py
a imported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment