From 3a38df12a9bfcba0731449f29ad89c7a67276122 Mon Sep 17 00:00:00 2001 From: linxiao Date: Tue, 24 Apr 2018 16:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DevicesInfo.py | 5 ++++- csetup.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DevicesInfo.py b/DevicesInfo.py index 7e6e1f4..3b297e9 100644 --- a/DevicesInfo.py +++ b/DevicesInfo.py @@ -1,6 +1,7 @@ import re import RunCMD from RunCMD import run_cmd +import cchardet class DevicesInfo(): @@ -33,7 +34,9 @@ class DevicesInfo(): devices_output_copy = devices_output[0:] devices_txt = '' for txt in devices_output_copy: - devices_txt += txt.decode('utf-8').replace(r'\r\n','') + # charset = cchardet.detect(txt) + # if charset + devices_txt += txt.decode('utf-8','ignore').replace(r'\r\n','') # print(dir(re)) print(devices_txt) results = re.findall(r'\[[^\]]+\]([^\[]+)',devices_txt) diff --git a/csetup.py b/csetup.py index 1014831..12aa5bd 100644 --- a/csetup.py +++ b/csetup.py @@ -3,6 +3,7 @@ from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = { 'include_files':['resource','ffmpeg-shared']} +install_exe_options = { 'install_dir' : 'd:\\record-camera-and-screen', 'build_dir':'build', 'install_exe':'d:\\record-camera-and-screen'} # GUI applications require a different base on Windows (the default is for a # console application). @@ -11,7 +12,7 @@ if sys.platform == "win32": base = "Win32GUI" executables = [ - Executable('RecordWindow.py', base=base, icon = 'resource/gutin.ico') + Executable('RecordWindow.py', base=base, icon = 'resource/gutin.ico', targetName = 'RecordWindow.exe') ] setup( name = "Gutin谷田会议视频录播管理系统", version = "0.2",