Using API POST command to 'Type' to console in PythonAnywhere. I can successfully 'Type' to the console, but how do I actually submit the command? - pythonanywhere

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).

Related

Alexa Skill from Visual Studio Code

First of all, sorry if this is a duplicate, but I couldn't find any info after searching for a while
I want to code an Alexa skill from VSCode using Python, as I prefer it rather than coding on the browser. I tried following the steps on "offline tools"(image) but I've been struggling to get it working
Option A, extension:
When I open the Alexa Skill Toolkit(ASK) VSCode extension, sign in and try to import my existing project, it asks for some git credentials which I couldn't get after following this tutorial.
Manually making the petition from Python ends up with a 401 Response
(I don't know what the value of the Authorization header should
be)
Executing ask util git-credentials-helper didn't work either
Option B, CLI:
After installing NodeJS and ASK-CLI, i get a could not fetch origin error using
ask init --hosted-skill-id amzn1.ask.skill.myId
I probably just made a lot of dumb mistakes but I'm really confused rigth now, thanks in advance for the help
A "401" error code means you are unauthorized. I'm assuming you didn't try to put anything in that header because you didn't what what you should have put there. Here's a guide to get an access token for your authorization header: https://developer.amazon.com/en-US/docs/alexa/smapi/get-access-token-smapi.html

Using codemirror to execute code on server

Novice to Codemirror.
I have codemirror running on my server I have it set to Python mode. Can someone please suggest how I go about executing the code and showing the result on the page where I have written the python code
Thanks
Without knowing much about your setup, here's a general idea:
Use the getValue() method to get the code from your CodeMirror instance.
Assuming the code is a run-able Python script, you can either
(1) send the code to your back end with AJAX or a POST request and run it there. Or (2) you could run the Python script in the browser with a library like one discussed here.
If you ran it on the back end, you can send the result of running the code back as text or JSON with your preferred protocol. If you ran it on the browser, you should probably follow the guidelines for the specific library you used.

How to debug ExecuteFunctions for word add-in?

I'm implementing a functionality which runs in background(without Taskpanel), where I can POST the word document data to REST API through the ExecuteFunctions. my question here is How can I debug the Function file? I tried printing through the console logs and also tried to debug through F12 and Visual studio tools, but didn't work. I have created word add-in using YO Office generator.
To answer the question as is, simplest way of debugging the functions is through the Web experience (https://onedrive.live.com), where they will print stuff on the console.
You should probably check out this answer though: Run add-in without showing taskpane?
You really can't run background tasks without having a TaskPane. Functions are meant to just plainly execute something and exit. That means; upon clicking the Function button, you can make a request and upload some data, but you can't really keep a connection open and upload periodically after just one click.

KsqlRestClient.makeKsqlRequest("RUN SCRIPT ...") doesn't work without filling ksql.schema.file.content with the script content yourself

In my Scala application, I am trying to tell my KSQL Server that it should execute the RUN SCRIPT <script> command, using the KsqlRestClient.makeKsqlRequest(String ksql) function. Every time I tried it, nothing happened, even though the response was successful, so I started debugging, where I saw that the response was a success but it also returned some kind of error that the property ksql.schema.file.content was empty.
Since I did not find any documentation as to what to fill this property with, I tried some things and eventually found out that if you fill this property with the contents of your .sql file, the run script command works.
Does anybody know if and with what ksql.schema.file.content should normally be filled and/or if the way I am using it is how your supposed to execute a script in KSQL from a Scala application. I already copy and pasted the text from the makeKsqlRequest into the KSQL CLI and everything worked fine, so there should be no error with that.
There is a Github issue tracking the fact that the RESTful API is not documented / supported yet, (as of March 2018).
It sounds like this is something you may want to add a +1 too.

Problems with Forms2Go script

I am currently trying to make a form for a website in work. I have created the script in Perl using Forms2Go and have entered the send mail and bin paths given to me. At the first the script wouldn't execute but the hosts made changes to the sever and now it does.
Problem now is the script executes and takes the user to the thank you page but doesn't send the form to the e-mail address which has been tested by the hosting company.
I have a feeling that the send-mail path isn't correct and that is why it is executing but not sending the email, anything else it might be?
Thanks for reading.
Tom
Forms To Go is payware and they do not provide their source code publicly which makes trouble-shooting by the general Internet populace rather difficult. Try their support forum instead. If you're looking for a form mailer that does not suck, install nms TFMail.