乐谱xml文件转化为拼音

2021-01-14 11:40:45 浏览数 (1)

乐谱xml歌词转化为拼音

using

代码语言:javascript复制
python3 xml2Pinyin.py  xml_in_dir  xmlpy_out_dir

代码语言:javascript复制
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "errrolyan"
# Date: 18-10-16
# Describe = "乐谱xml文件转化为拼音”

import os,re,sys
import os.path
import xml.etree.ElementTree as ET
import pinyin
from collections import Counter

def coverFiles(sourceDir,  targetDir):
    for files in os.listdir(targetDir):
        filepath = os.path.join(targetDir,files)
        os.remove(filepath)
    for file in os.listdir(sourceDir):
        sourceFile = os.path.join(sourceDir,  file)
        targetFile = os.path.join(targetDir,  file)
        if os.path.isfile(sourceFile):
            open(targetFile, "wb").write(open(sourceFile, "rb").read())


def fileread(filepath):
    pathDir = os.listdir(filepath)
    for s in pathDir:
        newDir = os.path.joi

0 人点赞