

Outs, errs = proc.I want to run a bash subshell, (1) run a few commands, (2) and then remain in that subshell to do as I please. It blurbs out all the output only when I kill the debug otherwise it hangs. I've also tried using this other snippet of code, which waits for a timeout, but it behaves more or less in a similar fashion. but at this point is too late.įrom the user's point of view, if no browser page opens, the application still looks like is frozen. Once I click the cancel button (or the login button) on the web page I can finally see the output of stdout containing the message I'm interested in and the execution move forward. Then execution moves to the next line which attempts to write on console the stdout, at this point it hangs and doesn't print anything until I take action on the web page. it runs), at this point the web page opens. The behavior during debugging is that the execution goes over the popen line (i.e. So I'm now calling the API CLI script with Popen and trying to print the stdout just to see what happens. I'm trying but still can't wrap my head around it. Hi, thanks for the pointer to the Popen method. Print(f"Error: The API CLI was not found")

This is the code I'm using, perhaps I've missed something in the n instructions, but I can't find anything in the documentation that remotely resembles what I'd like to do. Is there any way I can intercept this process and message while it is running so I can display a nice message on the screen for the user with the instructions? user login on the web page) the client will finish its work and confirm the login and I can finally see the result as this is returned by n


This is not shown on the shell while the client is running, so it appears like my script is frozen. As fallback the client writes on the stdout a message with the URL and the authorization code to use, waiting for the user to manually open the browser and perform the operation, then it can intercept the callback and move forward with the process. Now on my machine, all works great, but on some other systems, the browser doesn't open. To authenticate on the system I call a local client via the n function, this process will open a new tab in the default browser so that the user can authenticate (it uses 2FA hence the need for this process). I'm writing a small CLI script to perform certain operations on a public API, it all works well but I have a small problem with the authentication part.
