I've written a python program that uses features from the matplotlib library and I have a github website that I want to upload the file to so that people who visit the site can use the program. Any advice on how to do this? Do I need to use django or flask or something?
1 Answer
Repl.it has an embed function: https://docs.repl.it/repls/embed. Just create a repl with your code, then include the iframe in your website.
Extending on my comment, if you go to repl.it, add your code and dependencies, and save the file, all you have to do is add the repl url as the src.parameter in this iframe:
<iframe
frameborder="0"
width="100%"
height="500px"
src="YOUR_REPL_URL"
></iframe>
and you can add it to your website.
Also, repl.it supports interactive python plots
Here's a demo of a matplotlib repl:
<iframe
frameborder="0"
width="100%"
height="500px"
src="https://repl.it/@marsnebulasoup/AwesomeSimplisticDictionaries?lite=true"
></iframe>
You can also add the outputonly=1 param to the repl url to hide the editor.
This is how the output looks when you run the above repl:
More here: docs.repl.it/repls/embed
Apart from this, trinket is another alternative to repl.it that's worth looking into. It only returns an image.
