(file)
转换格式：md5转换成rst
转换格式：md5转换成rst
转换格式：md5转换成rst
def convert_md5_to_rst(file):
    '''
    转换格式：md5转换成rst
    '''
    (filename, extension) = os.path.splitext(file)
    convert_cmd = 'pandoc -V mainfont="SimSun" -f markdown -t rst {md_file} -o {rst_file}'.format(
        md_file=filename+'.md', rst_file=filename+'.rst'
    )
    # status, output = commands.getstatusoutput(convert_cmd)
    status = subprocess.call(convert_cmd.split(" "))
    if status != 0:
        print("命令执行失败: " + convert_cmd)
        os._exit(1)
    if status == 0:
        print(file + ' 处理完成')
    else:
        print(file + '处理失败')
def convert_md5_to_rst ( file ) : ( filename , extension ) = os . path . splitext ( file ) convert_cmd = 'pandoc -V mainfont="SimSun" -f markdown -t rst {md_file} -o {rst_file}' . format ( md_file = filename + '.md' , rst_file = filename + '.rst' ) # status, output = commands.getstatusoutput(convert_cmd) status = subprocess . call ( convert_cmd . split ( " " ) ) if status != 0 : print ( "命令执行失败: " + convert_c d os . _exit ( 1 ) if status == 0 : print ( file + ' 处理完成') else : print ( file + '处理失败')