diff --git a/gui/Application.py b/gui/Application.py index 0a83ff8..d7fad2c 100644 --- a/gui/Application.py +++ b/gui/Application.py @@ -72,9 +72,15 @@ def __init__(self): # 读取配置 self.load_configure() - # 获取python解释器的路径 - self.python3 = sys.executable.replace('\\', '/') - # python3 = 'python' # exe发布版 + # 获取解释器的路径 + python3 = sys.executable.replace('\\', '/') + if python3.split('/')[-1] in ['py','py3','python','python3','python.exe','python3.exe']: + self.python3 = python3 + ' ./{}.py' + else: + if sys.platform == 'win32': + self.python3 = './RplGenCore.exe --module {}' + else: + self.python3 = './RplGenCore --module {}' # 创建组件 self.create_widgets() diff --git a/gui/appframes/MainFrame.py b/gui/appframes/MainFrame.py index 3f931bb..6502fb1 100644 --- a/gui/appframes/MainFrame.py +++ b/gui/appframes/MainFrame.py @@ -95,7 +95,7 @@ def run_command_main(self): 在命令行运行主程序 """ optional = {1:'--OutputPath {of} ',2:'--ExportXML ',3:'--ExportVideo --Quality {ql} ',4:'--SynthesisAnyway --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} ',5:'--FixScreenZoom '} - command = self.app.python3 + ' ./replay_generator.py --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} ' + command = self.app.python3.format('replay_generator') + ' --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} ' command = command + '--FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Language zh ' if self.app.output_path.get()!='': command = command + optional[1].format(of=self.app.output_path.get().replace('\\','/')) diff --git a/gui/appframes/Mp4Frame.py b/gui/appframes/Mp4Frame.py index c377704..a1e4aad 100644 --- a/gui/appframes/Mp4Frame.py +++ b/gui/appframes/Mp4Frame.py @@ -65,7 +65,7 @@ def run_command_mp4(self): """ 执行导出mp4的命令 """ - command = self.app.python3 + ' ./export_video.py --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Quality {ql} --Language zh ' + command = self.app.python3.format('export_video') + ' --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Quality {ql} --Language zh ' if '' in [self.app.timeline_file.get(),self.app.media_define.get(),self.app.output_path.get(), self.app.project_W.get(),self.app.project_H.get(),self.app.project_F.get(),self.app.project_Z.get(),self.app.project_Q.get()]: messagebox.showerror(title='错误',message='缺少必要的参数!') diff --git a/gui/appframes/SynthFrame.py b/gui/appframes/SynthFrame.py index e2e62df..daef9ef 100644 --- a/gui/appframes/SynthFrame.py +++ b/gui/appframes/SynthFrame.py @@ -99,7 +99,7 @@ def run_command_synth_preview(self,init_type='Aliyun'): """ 执行试听命令 """ - command = self.app.python3 +' ./speech_synthesizer.py --PreviewOnly --Init {IN} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh ' + command = self.app.python3.format('speech_synthesizer') +' --PreviewOnly --Init {IN} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh ' command = command.format(IN=init_type, AK=self.app.AccessKey.get(), AS=self.app.AccessKeySecret.get(),AP=self.app.Appkey.get(),AZ=self.app.AzureKey.get(),SR=self.app.ServiceRegion.get()).replace('\n','').replace('\r','') try: print('\x1B[32m'+command+'\x1B[0m') @@ -115,7 +115,7 @@ def run_command_synth(self): """ 执行语音合成命令 """ - command = self.app.python3 +' ./speech_synthesizer.py --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} --OutputPath {of} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh ' + command = self.app.python3.format('speech_synthesizer') +' --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} --OutputPath {of} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh ' if '' in [self.app.stdin_logfile.get(),self.app.characor_table.get(),self.app.media_define.get(),self.app.output_path.get(),self.app.AccessKey.get(),self.app.AccessKeySecret.get(),self.app.Appkey.get(),self.app.AzureKey.get(),self.app.ServiceRegion.get()]: messagebox.showerror(title='错误',message='缺少必要的参数!') else: diff --git a/gui/appframes/XmlFrame.py b/gui/appframes/XmlFrame.py index f4b7e9a..7810f8d 100644 --- a/gui/appframes/XmlFrame.py +++ b/gui/appframes/XmlFrame.py @@ -61,7 +61,7 @@ def create_widgets(self): def run_command_xml(self): """执行导出xml的命令""" - command = self.app.python3 + ' ./export_xml.py --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Language zh ' + command = self.app.python3.format('export_xml') + ' --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Language zh ' if '' in [self.app.timeline_file.get(),self.app.media_define.get(),self.app.output_path.get(), self.app.project_W.get(),self.app.project_H.get(),self.app.project_F.get(),self.app.project_Z.get()]: messagebox.showerror(title='错误',message='缺少必要的参数!') diff --git a/gui/utils.py b/gui/utils.py index 4c5dff4..d5de950 100644 --- a/gui/utils.py +++ b/gui/utils.py @@ -3,7 +3,7 @@ """ from tkinter import colorchooser, filedialog, messagebox -EDITION = '1.16.5' +EDITION = '1.16.6' def browse_file(text_obj, method='file',filetype=None): """