国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【原創(chuàng)】Python 使用jmpy模塊加密|加固 python代碼

2022-06-13 15:37 作者:拉燈的小手  | 我要投稿

?本文所有教程及源碼、軟件僅為技術(shù)研究。不涉及計算機信息系統(tǒng)功能的刪除、修改、增加、干擾,更不會影響計算機信息系統(tǒng)的正常運行。不得將代碼用于非法用途,如侵立刪!

使用jmpy模塊 將py文件加密為so或pyd

操作環(huán)境

  • win10 、 mac

  • Python3.9

  • jmpy1.0.6

jmpy官方介紹

簡介

將python代碼一鍵加密為so或pyd。支持單個文件加密,整個項目加密。

Git倉庫地址: https://github.com/Boris-code/jmpy.git

安裝

pip install jmpy3

使用方法

jmpy -i "xxx project dir" [-o output dir]

加密后的文件默認存儲在 dist/project_name/ 下

打包使用

jmpy 加密模塊

# -*- coding: utf-8 -*-
"""
py文件加密為so或pyd
python代碼 加密|加固
參數(shù)說明:
? ?-i | --input_file_path ? ?待加密文件或文件夾路徑,可是相對路徑或絕對路徑
? ?-o | --output_file_path ? 加密后的文件輸出路徑,默認在input_file_path下創(chuàng)建dist文件夾,存放加密后的文件
? ?-I | --ignore_files ? ? ? 不需要加密的文件或文件夾,逗號分隔
? ?-m | --except_main_file ? 不加密包含__main__的文件(主文件加密后無法啟動), 值為0、1。 默認為1

報錯:
? ?AttributeError: 'str' object has no attribute 'decode'
? ?找到報錯文件:_msvccompiler.py
? ?參考:https://blog.csdn.net/qq_43192819/article/details/108981008
? ?128行代碼修改為:.encode().decode('utf-16le', errors='replace')
"""

from jmpy.encrypt_py import start_encrypt
# 需要加密的py文件
input_file_path = "test.py"
# 直接運行
start_encrypt(input_file_path=input_file_path, output_file_path=None, ignore_files=None, except_main_file=0)

報錯解決:AttributeError: ‘str’ object has no attribute 'decode’

初次使用時碰到了一個:AttributeError: 'str' object has no attribute 'decode'的報錯 原因:Python2和Python3在字符串編碼上的區(qū)別。 解決方法:先encode()轉(zhuǎn)為字節(jié)碼在進行解碼 ? ? ?找到報錯文件:_msvccompiler.py ? ?參考:https://blog.csdn.net/qq_43192819/article/details/108981008 ? ?128行代碼修改為:.encode().decode('utf-16le', errors='replace') ?

資源下載

https://download.csdn.net/download/qq_38154948/85629166

本文僅供學(xué)習(xí)交流使用,如侵立刪!


【原創(chuàng)】Python 使用jmpy模塊加密|加固 python代碼的評論 (共 條)

分享到微博請遵守國家法律
台中县| 南郑县| 腾冲县| 新余市| 嘉鱼县| 黔南| 阿图什市| 获嘉县| 九江县| 武鸣县| 阿拉尔市| 页游| 个旧市| 通城县| 荣成市| 万源市| 鱼台县| 青神县| 玉林市| 亳州市| 伊吾县| 正镶白旗| 会泽县| 松阳县| 鄂托克前旗| 双流县| 阳高县| 瓦房店市| 林甸县| 灵石县| 福海县| 鸡泽县| 盐亭县| 玉林市| 旬邑县| 西平县| 淳化县| 赤水市| 肇庆市| 安岳县| 丰顺县|