diff --git a/readme.md b/readme.md index e61384a..9f67f8b 100644 --- a/readme.md +++ b/readme.md @@ -57,6 +57,7 @@ 3. Server 和 Client 以 tab 集成在一个 gui,无任务栏占用。 4. 双击 start.exe 运行,可自行设置开机自启动。 5. 已包含所有 Python 环境和 models 模型,解压即用。 +6. 支持转录功能,将文件拖动到 start_client_gui.exe 下载地址: diff --git a/start _client_gui.exe b/start_client_gui.exe similarity index 100% rename from start _client_gui.exe rename to start_client_gui.exe diff --git a/start _client_gui.py b/start_client_gui.py similarity index 88% rename from start _client_gui.py rename to start_client_gui.py index 0513cd0..85b80f4 100644 --- a/start _client_gui.py +++ b/start_client_gui.py @@ -1,3 +1,4 @@ +import os import sys import subprocess from queue import Queue @@ -116,8 +117,17 @@ def update_text_box(self): self.text_box_client.append(line) if __name__ == '__main__': - app = QApplication([]) - apply_stylesheet(app, theme='dark_teal.xml') - gui = GUI() - gui.show() - sys.exit(app.exec()) + if sys.argv[1:]: + # 如果参数传入文件,那就转录文件 + CapsWriter_path = os.path.dirname(os.path.abspath(__file__)) + script_path = os.path.join(CapsWriter_path, 'core_client.py') + python_exe_path = os.path.join(CapsWriter_path, 'runtime\\python.exe') + args = [arg for arg in sys.argv[1:]] + subprocess.run([python_exe_path, script_path] + args) + else: + # GUI + app = QApplication([]) + apply_stylesheet(app, theme='dark_teal.xml') + gui = GUI() + gui.show() + sys.exit(app.exec())