Created
July 24, 2015 21:04
-
-
Save lost-theory/c9d9b2e8275e803d75e3 to your computer and use it in GitHub Desktop.
Revisions
-
lost-theory created this gist
Jul 24, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ $ find . -type f -name "*.py" ./setup.py ./mypkg/__init__.py ./mypkg/config.py ./mypkg/shapes/__init__.py ./mypkg/shapes/square.py $ find . -type f -name "*.py" | xargs head -n999 ==> ./setup.py <== from setuptools import setup, find_packages setup( name="mypkg", version="0.1", packages=find_packages(), ) ==> ./mypkg/__init__.py <== ==> ./mypkg/config.py <== SIZE = 4 ==> ./mypkg/shapes/__init__.py <== ==> ./mypkg/shapes/square.py <== from mypkg.config import SIZE def square(size=SIZE): edge = "*"*size inside = "*" + " " * (size-2) + "*" yield edge for i in range(size-2): yield inside yield edge if __name__ == "__main__": print "\n".join(square()) $ virtualenv ~/foo-env New python executable in /Users/stevek/foo-env/bin/python Installing setuptools, pip...done. $ ~/foo-env/bin/python setup.py develop ... Finished processing dependencies for mypkg==0.1 $ ~/foo-env/bin/python mypkg/shapes/square.py **** * * * * ****