Search code examples
pythonserverskulpt

How to run Skulpt.org on localhost / local server by XAMPP


Hi i want to measure execution time of basic operations like range etc. on Skulpt(Python in browser) I know thath Skulpt.org have interactive console online, but the thing is that I want to do it on my local machine, on my local server created by XAMPP.

I have this simple code:

import time

t0 = time.time()
for i in range(1000000):
    a = 1
print("assignment.py", time.time()-t0)

How can I run it on simple webpage index.html on my local server using Skulpt?


Solution

  • Here is answer.

    <html> 
    <head> 
    <meta charset="utf-8">
    <title>Skulpt</title>
    <script src="skulpt.min.js" type="text/javascript"></script> 
    <script src="skulpt-stdlib.js" type="text/javascript"></script> 
    </head> 
    <body> 
    </body> 
    </html>
    

    To folder with index.html you must add 2 files:

    skulpt.min.js

    skulpt-stdlib.js