首页 > 代码库 > cocos3 python 写android.mk

cocos3 python 写android.mk

import os   dir = D:/hero/Classesdef readfile(dir):    str=""    first_line=1    for f in os.listdir(dir):        file = os.path.join(dir, f)        if os.path.isdir(file):            readfile(file)        elif os.path.isfile(file):            newfile=file            basename=os.path.basename(newfile)            backsuf=basename.split(.)[-1]            if backsuf=="cpp":                if first_line==1:                    str+="                   ../../Classes/"+basename                    first_line=0                else:                    str+="\\"+"\n"+"                   ../../Classes/"+basename    print str    return strstr_to_write=readfile(dir)file = open(Android.mk, w)file.write(str_to_write)file.close()

 

cocos3 python 写android.mk