如何将Python脚本添加到HTML

如何将Python脚本添加到HTML,python,html,python-turtle,code.org,Python,Html,Python Turtle,Code.org,我有一个python脚本,我想在code.org上使用HTML显示它,但我不知道我可以使用什么命令或方法来显示我想显示的内容。下面是我想在其中运行的HTML和python脚本的示例。(python代码因发布而缩短) 简短答复: 你不能 长答覆: Python不能在网页上运行,它是一种后端语言。您可能希望使用JavaScript和HTML画布对象在其上进行绘制。您可以使用google“JavaScript在画布上绘制”作为起点 顺便说一句:要将海龟放在底部,可以在Python中使用fab.goto

我有一个python脚本,我想在code.org上使用HTML显示它,但我不知道我可以使用什么命令或方法来显示我想显示的内容。下面是我想在其中运行的HTML和python脚本的示例。(python代码因发布而缩短)

简短答复: 你不能

长答覆: Python不能在网页上运行,它是一种后端语言。您可能希望使用JavaScript和HTML画布对象在其上进行绘制。您可以使用google“JavaScript在画布上绘制”作为起点

顺便说一句:要将海龟放在底部,可以在Python中使用
fab.goto(x,y)

import turtle as fab
import pandas as pd

platform = [0.00151,0.00318,0.00436,0.00551,0.00563,0.00989,0.01196]

fab.speed(10)
fab.pensize(2.5)
fab.penup()
fab.right(90)
fab.forward(300)
fab.left(90)
fab.pendown() #sets the turtle in place at the bottom of the screen

fab.color('#49514c') #black colour for amazon
fab.begin_fill()
fab.circle(platform[6]*30000) # draws the circle for amazon music unlimited
fab.end_fill()

fab.penup()
fab.forward(450)
fab.left(90)
fab.forward(400)
fab.right(90)
fab.pendown() #moving the pen to write the text

fab.color('#49514c')
fab.write('Amazon Music Unlimited!', move=False, align="left", font=("Comic Sans", 20, "normal"))
fab.penup()
fab.right(90)
fab.forward(50)
fab.left(90)
fab.pendown() #write amazon