[Python] 纯文本查看 复制代码
import os
# 配置控制台环境为Powe ...[/quote]
#我贴一下我的spec,请大佬帮我看看,这样还是cmd,没有变PS:
[mw_shl_code=python,true]
# 配置控制台环境为PowerShell
import os
exe = os.path.join(os.environ['SystemRoot'], 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe')
block_cipher = None
a = Analysis(
['test.py'],
pathex=[],
binaries=[(exe, 'powershell.exe')],
datas=[('testConfig.ini', '.')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
[],
exclude_binaries=True,
name='test',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['network.ico'],
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='test',
)