hauntek/python-ngrok

请问有openwrt上运行的教程吗?

Closed this issue · 13 comments

zasl commented

非常感谢

openwrt 安装python运行脚本就可以了

zasl commented

你好,因为在windows下面也没有接触过python,所以openwrt我虽然安装了python,但是也不知道如何运行,麻烦您给我这类的新手说下应该如何操作,谢谢了。

windows安装好python3以上的版本,配置好环境变量,直接双击py脚本就运行了

openwrt需要安装python3以上的版本,python路径+脚本路径运行,或者cd到脚本路径 python python-ngrok.py

建议你先在windows熟悉下python,或者openwrt安装好python+pyinstaller,可以直接编译二进制,无需依赖python环境

zasl commented

非常感谢您的解答,win下并没有配置python3的环境,应为很少用到这个,不过路由器配置了,都是openwrt最新版官方源下载安装的,python路径还真不知道在哪里,不过我去找找资料,脚本就是那个。py的文件下载就可以了吧

zasl commented

请问我在openwrt下默认安装的是Python 2.7.12,你说的Python3以上的版本是这个吧

python3 -V

Python 3.5.2
我两个都装了,应该没什么问题吧

zasl commented

openwrt提示错误

File "/tmp/python-ngrok.py", line 5

^
SyntaxError: invalid syntax

python3 python-ngrok.py

zasl commented

win10 64位周年版,官方下载python3.52,根据网上提供的安装方法,在安装的时候自动添加环境变量。执行还是报错
双击是个一闪而过的窗口。IDLE里面按F5提示invalid syntax

看来我与python的程序无缘了?

如果你2个python版本都安装了,双击估计是以python2版本运行的,建议用cmd命令 python3 路径+python-ngrok.py

例如:python3 C:\Users\hauntek\Desktop\python-ngrok.py

zasl commented

正好系统坏了,重新安装系统,只安装了python3
C:\Program Files\Python35>python C:\Users\uslxt\Desktop>SubFinder.py python-ngrok.py
C:\Program Files\Python35\python.exe: can't find 'main' module in 'C:\Users\uslxt\Desktop'

C:\Program Files\Python35>python C:\Users\uslxt\Desktop\SubFinder.py python-ngrok.py
File "C:\Users\uslxt\Desktop\SubFinder.py", line 147
print '%s' % subfilename
^
SyntaxError: Missing parentheses in call to 'print'

路由器还是lin5的那个错误提示,也是只安装了python3

现在支持python2.7直接运行了,例如:linux,openwrt

  • 先赋予755权限,然后直接运行
chmod 755 python-ngrok.py
./python-ngrok.py