Pyinstaller / Pyarmor IndexError

问题描述

我正在制作一个Python脚本,该脚本将通过.txt文件来查找实时代理。该程序在Python中运行,并在需要时调用“代理”定义,因此脚本将一直运行,直到调用“代理”为止。

(The Python source code)

def proxies():
    proxy_file = open("proxy.txt","r")
    proxy_text = proxy_file.readlines()
    line = random.choice(proxy_text)
    ip = line.replace("\n","")
    if str(ip).startswith("http"):
        pass
    else:
        https = "https://"+ip
        http = "http://"+ip
    proxy = {
        "https":https,"http":http
    }
    return proxy   

-

如果使用pyarmor对其进行混淆和打包,则无法读取文件

enter image description here

这是我用来打包pyarmor的代码:“ pyarmor pack -e”-onefile“ file.py”

-

然后,如果我尝试通过pyinstaller打包,则会遇到类似的问题

enter image description here

这是我用来打包pyinstaller的代码:pyinstaller --onefile file.py

-

如果有人知道我该如何解决此问题,将不胜感激:)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)