pyqt在windows下的cmd相关
2021-07-11 02:06
标签:test kernel star read signal tmp console strip out 1. cmd调用 (1) time.sleep(2) subprocess.call(‘taskkill /F /IM 。。。.exe‘, creationflags=CREATE_NO_WINDOW) 2.打包后的cmd隐藏 (1) import ctypes (4) spec文件 pyqt在windows下的cmd相关 标签:test kernel star read signal tmp console strip out 原文地址:https://www.cnblogs.com/moon-fire/p/9660748.htmlshell_cmd = ‘...‘
cmd = shlex.split(shell_cmd)
p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)while p.poll() is None:
line = p.stdout.readline()
line = line.strip()
if line:
s1 = str(line, encoding=‘utf-8‘) # encoding=‘gb2312‘
resture += s1
(2)模拟双击CREATE_NO_WINDOW = 0x08000000
os.startfile("。。。.exe")
几种方法组合食用效果更佳:
whnd = ctypes.windll.kernel32.GetConsoleWindow()
if whnd != 0:
ctypes.windll.user32.ShowWindow(whnd, 0)
ctypes.windll.kernel32.CloseHandle(whnd)()(2)
shell_cmd = ‘...‘
cmd = shlex.split(shell_cmd)
p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)while p.poll() is None:
line = p.stdout.readline()
line = line.strip()
if line:
s1 = str(line, encoding=‘utf-8‘) # encoding=‘gb2312‘
resture += s1
(3)CREATE_NO_WINDOW = 0x08000000
subprocess.call(‘taskkill /F /IM test8_btc.exe‘, creationflags=CREATE_NO_WINDOW)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=‘test_addr‘,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False ) # console置为False
文章标题:pyqt在windows下的cmd相关
文章链接:http://soscw.com/index.php/essay/103496.html