Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run python in the web with github.io?

Tags:

I want to run a python file in the web I have in a GitHub repository. Is it possible to do this?

And by running in the web, I mean putting #!/usr/bin/python and print 'Content-type:text/html\n in the first two lines.

like image 598
brandbest1 Avatar asked Jun 19 '14 00:06

brandbest1


People also ask

Can I run Python on GitHub?

Run Python Script is not certified by GitHub.

Can you run Python in a Web browser?

Brython is both a Python compiler and an interpreter written in JavaScript. As a result, you can compile and run Python code in the browser. A good example of this feature is demonstrated by the online editor available on the Brython website. With the online editor, Python is running in the browser.


1 Answers

In general this is not possible, Github (pages) serves only static content (ex: HTML, CSS, JS). If you want python to run (ex generate dynamic content) you need a web server capable of running python (your browser were the contents of GitHub Pages get downloaded and run can't do it).

That said there are experimental ways of running subsets of python in the browser. Take a look for a example at this question.

like image 83
elyase Avatar answered Oct 14 '22 17:10

elyase