
Ich weiß dafür keine Lösung.
Voraussetzung: Zu zerlegender MP3-File im gleichen Verzeichnis wie das (noch unausgereifte) Skript:
Code: Alles auswählen
#!/usr/bin/python3.1
# -*- coding: iso-8859-15 -*-
import sys
import shlex
import subprocess
from tkinter import *
import os
sep = "/"
stdout_encoding = sys.stdout.encoding
stdout_encoding = sys.getfilesystemencoding()
#stdout_encoding = sys.stdout.encoding or sys.getfilesystemencoding()
strPath = os.path.realpath(__file__)
strPath = strPath.rsplit(sep)
strPath = strPath[:-1]
strPath = sep.join(strPath)
def ende():
sys.exit(0)
def cutFile():
end = txtEnd.get()
end = end.rstrip()
if end == "":
end = "EOF"
start = txtBegin.get()
start = start.rstrip()
if (start == "") and (end == "EOF"):
pass
else:
# Joker "*.mp3" ging hier auch nicht?!
args = 'mp3splt ' + strPath + sep + '\'Die geschuetzten Männer.mp3\' ' + start + ' ' + end
args.encode(stdout_encoding)
args = shlex.split(args)
print(args)
p = subprocess.Popen(args)
#p = Popen(['metaflac','--show-tag=%s' % tag, path], stdout=PIPE)
frmHauptfenster = Tk()
lblBegin = Label(frmHauptfenster, text = "Beginn")
lblBegin.pack()
txtBegin = Entry(frmHauptfenster)
txtBegin.pack()
lblEnd = Label(frmHauptfenster, text = "Ende")
lblEnd.pack()
txtEnd = Entry(frmHauptfenster)
txtEnd.pack()
btnOK = Button(frmHauptfenster, text = "OK", command = cutFile)
btnOK.pack()
btnEnde = Button(frmHauptfenster, text = "Schliessen", command = ende)
btnEnde.pack()
frmHauptfenster.mainloop()