#coding:utf-8
import os
#-------代码段一
#获取当前文件夹
filePath = os.getcwd()
#获取当前文件列表
fileNameList = os.listdir(filePath)
fileDirList = []
#获取文件路径列表
for fileName in fileNameList:
fileDirList.append(os.path.join(filePath, fileName))
#--------代码段二
f = open('code.txt', 'w')
f.write("开始写文件n")
f.close()
for code in fileDirList:
f = open('code.txt', 'a')
split = os.path.splitext(code)
if(split[1] == '.h' or split[1] == '.cpp'):
fz = open(code, 'r')
string = "源代码文件" + code +"代码:n"
f.write(string)
content = fz.read()
print "文件 %s 读写成功" % code
f.write(content)
fz.close()
f.close()
print "读写成功" catomy/ppt_analysis_opt_skill README 风格项目教程
鹅鸭杀嘉年华狼任务怎么做 鹅鸭杀嘉年华模式狼介绍
HillClimbRacing下载量突破20亿-官方简讯发布
阿里云百炼Token Plan和Coding Plan省钱订阅计划:如何选择?有哪些区别?
最新:阿里云万小智收费价格:活动15元1个月:180元1年:轻量版、标准版及高级版功能支持
移动端的AI助手不应只是客服窗口:更应借助AI能力将小程序服务变成可调用能力