qiuri2008

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
def fun_getBinCountToProject():
with open("../aps/application/radisson/formal/sys_common_guiobj/app_guiobj_setup.c", "r") as project_op:
temStr = '#define CONFIG_FLASH_BIN_COUNT ' + str(len(g_listBin));
content = project_op.read();

pos = content.find('#define CONFIG_FLASH_BIN_COUNT');
if pos != -1:
pos_end = content[pos:].find('\n');
content = content[:pos] + temStr + content[pos + pos_end:];
with open("../aps/application/radisson/formal/sys_common_guiobj/app_guiobj_setup.c","w") as project_op:
project_op.write(content);
posted on 2017-03-27 14:39  江召伟  阅读(203)  评论(0编辑  收藏  举报