def runNgrok():
ngrokDir = "/home/ubuntu/ngrokFunctionalities"
port = 8081
ngrok_command = "ngrok"
make_executable = str(Path(ngrokDir, ngrok_command))
ngrok = subprocess.Popen([make_executable, 'http', 127.0.0.2, '-inspect=false','-bind-tls=true', port])
atexit.register(ngrok.terminate)
time.sleep(7)
return True
File "ngrokRunKeepAlive.py", line 25
ngrok = subprocess.Popen([make_executable, 'http', 127.0.0.2, '-inspect=false','-bind-tls=true', port])
^
SyntaxError: invalid syntax
答案1
我认为你应该在 IP 两边加上引号。这是 Python,所以字符串应该用引号引起来。