Project structuring and file implementation in Python -
i having bit of troubles getting grasp on how structure python projects. have read jcalderone: filesystem structure of python project , been looking @ source code of couchapp, i'm still feeling puzzled.
i understand how files should structured, don't understand why. love if hook me detailed walk-through of this, or explain me. how set basic python project, , how files interact each other.
i think people coming other languages c, c++, erlang ... or people have never been programming before, benefit from.
name directory related project. when releases, should include version number suffix: twisted-2.5.
not sure why unclear. seems obvious. has in 1 directory.
why things have in 1 directory? because says so, that's why.
create directory twisted/bin , put executables there.
this way linux works. executables in bin
directory. makes easy put specific directory in path
environment variable.
if project expressable single python source file, put directory , name related project. example, twisted/twisted.py.
right. have /twisted, /twisted/bin , /twisted/twisted.py actual, running code in it. else put it?
there's no "why" this. else possibly put it?
if need multiple source files, create package instead (twisted/twisted/, empty twisted/twisted/init.py) , place source files in it. example, twisted/twisted/internet.py.
this way python packages work. they're directories __init__.py
files. tutorial pretty clear on this.
put unit tests in sub-package of package twisted/twisted/test/.
where else put tests? seriously. there's no "why?" this. there's no sensible alternative.
add twisted/readme , twisted/setup.py explain , install software, respectively
right. else put them? again. there's no "why?" go in top directory because -- -- that's directory for. contains files.
Comments
Post a Comment