0

Currently using the PythonAnywhere API to attempt to access a Python script I wrote that is hosted in a Virtual Environment in PythonAnywhere. Using the Bubble API Connector if that matters.

I figured out how to use the POST command in combination with "/api/v0/user/{username}/consoles/{id}/send_input/" to successfully send the text "python HelloWorld.py" to my PA console. However, I don't know how to get the API to actually have the console execute that command / text. Is there some text that represents hitting the 'Enter' button or something of that nature?

Sorry if this is a dumb question or has an obvious solution but I am pretty new to this.

Thanks in advance.

Tried new line tag "/n" as well as combing the PA forums, but no luck finding this specific topic.

Expecting my text to end up in the console (which is happening) and for it to Execute (not happening).

  • 1
    Did you send specifically `/n` as the newline character? If so, that would be the problem -- you should use a backlash, not a forward slash. So you would send the string `"python myscript.py\n"` – Giles Thomas Nov 27 '22 at 15:45

0 Answers0