本文整理汇总了Python中track.Track.path方法的典型用法代码示例。如果您正苦于以下问题:Python Track.path方法的具体用法?Python Track.path怎么用?Python Track.path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: indexFromFile
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import path [as 别名]
def indexFromFile(self):
self.file = open(os.getcwd() + '/options/index.txt', 'r')
path = None
line = self.file.readline()
while line != '':
code = line[0:2]
if code == "NP":
path = line[2:-1]
line = self.file.readline()
t = Track()
t.path = path + "/" + line[0:-1]
t.artist = self.file.readline()[0:-1]
t.title = self.file.readline()[0:-1]
t.album = self.file.readline()[0:-1]
self.tracks.append(t)
self.gui.addTrack(t)
line = self.file.readline()
self.file.close()
self.gui.loading_finished()
示例2: list
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import path [as 别名]
baseNameAdditional = aifSet + "fpBase.nbs"
maxLengthCheck = 100
tracks = list()
os.chdir(aifSet)
# Читаем файлы из директории
for dirname, dirnames, filenames in os.walk(aifSetAll):
for filename in filenames:
if fnmatch.fnmatch(filename, "*.aif"):
path = os.path.join(aifSetAll, filename)
track = Track()
track.path = path
tracks.append(track)
# Преобразование aif to wav
# for track in tracks:
# wavFileName = os.path.splitext(track.path)[0] + ".wav"
# subprocess.call([sox, track.path, wavFileName])
# track.path = wavFileName
# Делаем хеши полных файлов
for track in tracks:
track.hashPath = os.path.splitext(track.path)[0] + ".hash"
subprocess.check_output([hashBuild, track.path, track.hashPath])