python mark

##########################################按行读取txt########################################
file_input=open('path/to/file.txt')

file_list=[]
for line in file_input:
    content=line.strip()
    file_list.append(content)
    del content
file_input.close()
#############################################################################################
------------------------------------------------------------------------------------------------
##########################################python写txt细节########################################
写txt每行加一个'\n',最后一行没有空行的
#################################################################################################
------------------------------------------------------------------------------------------------
##########################################os.system########################################
os.system(cmd)
在终端执行cmd命令
#################################################################################################

posted on 2016-12-13 12:05  mathfinder  阅读(160)  评论(0编辑  收藏  举报

导航