关于--enable-bcc --mix-str混用 #2134
-
Windows x64, python 3.12, 整了附件中的一小段代码 (strMixDemo.py)重现这个情况: pyarmor gen --output prdist --pack onefile --enable-bcc strMixDemo.py pyarmor gen --output prdist --pack onefile --mix-str strMixDemo.py pyarmor gen --output prdist --pack onefile --enable-bcc --mix-str strMixDemo.py 请问:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
推荐使用 |
Beta Was this translation helpful? Give feedback.
-
请参考文档 |
Beta Was this translation helpful? Give feedback.
-
两种模式应该是可以一起使用的,如果存在问题,请参考 |
Beta Was this translation helpful? Give feedback.
-
import configparser
def load_wage_config(config_path: str) -> dict:
"""
从INI文件加载配置
返回包含以下键的字典:
- config1: str
- config2: str
- config3: str
"""
config = configparser.ConfigParser()
with open(config_path, 'r', encoding='utf-8') as f: # 关键修改
config.read_file(f)
# print("\n node3:")
if not config.has_section('demo_config'):
raise ValueError("INI文件中缺少 [demo_config] 节")
# print("\n node4:")
section = config['demo_config']
# print("\n node5:")
return {
'config1': section.get('config1'),
'config2': section.get('config2'),
'config3': section.get('config3'),
}
def getConfigs():
global config1
global config2
global config3
try:
config = load_wage_config('demo_config.ini')
# 直接解包使用
config1 = config['config1']
config2 = config['config2']
config3 = config['config3']
print("\n配置加载成功:")
print(f"config1: {config1}")
print(f"config2: {config2}")
print(f"config3: {config3}")
except Exception as e:
print(f"配置加载失败: {str(e)}\n\n")
print("请手动输入以下配置:")
config1 = input("输入config1:\n")
config2 = input("输入config2:\n")
config3 = input("输入config3:\n")
if __name__ == "__main__":
print("\n=========================================")
print("Load config test.")
print("=========================================\n")
getConfigs()
input()
|
Beta Was this translation helpful? Give feedback.
-
先试一下 pyarmor 9.1.5 有这个问题没 ? v9.1.5 解决了一个 BCC 加密问题 |
Beta Was this translation helpful? Give feedback.
-
这个问题将在下一个版本中解决 |
Beta Was this translation helpful? Give feedback.
这个问题将在下一个版本中解决
开发版本可以从这里下载
https://pyarmor.dashingsoft.com/downloads/temp/pyarmor-9.1.6.tar.gz