Score:0

run ngrok using subprocess. how to use subprocess with both ip address and port?

ng flag
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
                                
Score:0
cn flag

I think you should have quotes around the IP. This is Python, so strings should be quoted.

Paul avatar
cn flag
This seems like a comment...
cn flag
I can reword it to be an answer, my guess is that it'll solve the problem. But we need feedback from OP...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.