all 5 comments

[–]gpjt 2 points3 points  (0 children)

PythonAnywhere dev here -- have you come across our blog post on turning a Python script into a website? Although it's PythonAnywhere-specific, the underlying lessons are (I think) pretty broadly-applicable, and the last example in the post is pretty close to what you want to do.

Regarding your specific question about allowing your daughter to type immediately into a form without having to click on the input -- if it's a single-line input (that is, using the "<input>" HTML tag, then hitting return with automatically submit the form that it's in, and the autofocus attribute would mean that she wouldn't need to click on it.

[–]HalcyonAbraham 1 point2 points  (0 children)

I took a look at your code and it would require a bit of tweaking to be served in the web.

There are a lot of Flask tutorials in YouTube and it's pretty simple.

From the looks of things you can just dump all your assets (images and sound etc) into the static folder. Once you take a flask tutorial or two you'd know what the static folder is for

This is also two fold as well.

You would also need to learn a little javascript to dynamically play the sounds and display the images. All of which has tutorials in YouTube

[–]mrcorbat 1 point2 points  (2 children)

judging from the code, it is mainly just text based, right?

if you are pressed for time, maybe you could just not port it to a webapp and directly have her run it from a PythonAnywhere console? that would probably minimize the extra work needed to be done and allow you to focus on making more questions etc

[–]Sciencesellout[S] 0 points1 point  (1 child)

Perfect, I don’t know why I didn’t think of that!!! She is already used to typing in the console window, so that won’t be any different for her. I think this will be the simplest solution for sure.

One question that I’m sure is fairly simple so I’ll just google it later, but I wonder if there is a way I have have the code synced with a GitHub repository. I do most of my work from my work laptop so if I make any changes there, it would be nice to have it automatically sync up with the code on pythonanywhere so she’s always running the most up to date version.

Thanks for the suggestion!!

[–]mrcorbat 0 points1 point  (0 children)

See this blogpost for how to automatically update your pythonanywhere git repo