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

时间:2016-08-31 17:05:46

标签: python server skulpt

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?

1 个答案:

答案 0 :(得分:1)

这是答案。

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

要使用index.html文件夹,您必须添加2个文件:

  

skulpt.min.js

     

skulpt-stdlib.js