Created
February 27, 2012 17:40
-
-
Save bussiere/1925796 to your computer and use it in GitHub Desktop.
list app in a django project
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 characters
import os | |
chemin = "D:\Documents\Projets_Perso\Yuki" | |
#(, | |
#(models.Model) | |
#(null=True,blank=True) | |
#models.NullBooleanField(blank=True) | |
#models.BooleanField(null=True,blank=True) | |
def liste_app(chemin): | |
listfile = os.listdir(chemin) | |
listeapp = [] | |
for f in listfile : | |
if os.path.isdir(os.path.join(chemin, f)): | |
listindir = os.listdir(os.path.join(chemin, f)) | |
for f2 in listindir : | |
if f2 == "models.py": | |
listeapp.append(f) | |
print f | |
return listeapp | |
print liste_app(chemin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment