码迷,mamicode.com
首页 > 移动开发 > 详细

cocos3 python 写android.mk

时间:2014-12-20 11:33:29      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

import os  
 
dir = D:/hero/Classes
def 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 str

str_to_write=readfile(dir)
file = open(Android.mk, w)
file.write(str_to_write)
file.close()

 

cocos3 python 写android.mk

标签:

原文地址:http://www.cnblogs.com/yufenghou/p/4175114.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!