html中的Python终端?
在阅读(编辑:谢谢理解)之前,您可以对这个问题进行否决,因为标题是这样的,但其他问题只回答了如何在html中运行python程序,但我想做的是在html中使用python终端 伙计们,我脑子里其实有个大问题。我怎样才能像终端一样在html中使用python程序呢 这是我的项目,它将是一个互动词典,你可以学习词汇html中的Python终端?,python,html,python-2.7,Python,Html,Python 2.7,在阅读(编辑:谢谢理解)之前,您可以对这个问题进行否决,因为标题是这样的,但其他问题只回答了如何在html中运行python程序,但我想做的是在html中使用python终端 伙计们,我脑子里其实有个大问题。我怎样才能像终端一样在html中使用python程序呢 这是我的项目,它将是一个互动词典,你可以学习词汇 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=devic
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial
}
* {
box-sizing: border-box;
}
/* The browser window */
.container {
border: 3px solid #f1f1f1;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
/* Container for columns and the top "toolbar" */
.row {
padding: 10px;
background: #f1f1f1;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.scriptcontainer {
padding: 10px;
background: #ffffff;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.row2 {
padding: 5px;
background: #cc0000;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
/* Create three unequal columns that floats next to each other */
.column {
float: left;
}
.left {
width: 15%;
}
.right {
width: 10%;
}
.middle {
width: 75%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Three dots */
.dot {
margin-top: 4px;
height: 12px;
width: 12px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
}
/* Style the input field */
input[type=text] {
width: 100%;
border-radius: 3px;
border: none;
background-color: white;
margin-top: -8px;
height: 25px;
color: #666;
padding: 5px;
}
.bar {
width: 17px;
height: 3px;
background-color: #aaa;
margin: 3px 0;
display: block;
}
/* Page content */
.content {
padding: 10px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="column middle">
<h4><font size="6" type="Times">VocaDict</font></h4>
</div>
</div>
<div class="content">
<h3>=>Your dictionary:</h3>
<div class="row2"><div class="content"><div class="scriptcontainer"> <script>//This is where your dictionary will go!</script></div></div></div>
</div>
<div class="content">
<h3>=>Study lists:</h3>
<div class="row2"><div class="content"><div class="scriptcontainer"> <script>//This is where your dictionary will go!</script></div></div></div>
</div><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br>
</div>
</body>
</html>
身体{
字体系列:Arial
}
* {
框大小:边框框;
}
/*浏览器窗口*/
.集装箱{
边框:3px实心#f1f1;
边框左上半径:4px;
边框右上角半径:4px;
}
/*列和顶部“工具栏”的容器*/
.行{
填充:10px;
背景#f1f1;
边框左上半径:4px;
边框右上角半径:4px;
}
.scriptcontainer{
填充:10px;
背景:#ffffff;
边框左上半径:4px;
边框右上角半径:4px;
}
.row2{
填充物:5px;
背景:#cc0000;
边框左上半径:4px;
边框右上角半径:4px;
}
/*创建三个相邻浮动的不相等列*/
.栏目{
浮动:左;
}
.左{
宽度:15%;
}
.对{
宽度:10%;
}
.中{
宽度:75%;
}
/*清除列后的浮动*/
.罗:之后{
内容:“;
显示:表格;
明确:两者皆有;
}
/*三点*/
多特先生{
利润上限:4倍;
高度:12px;
宽度:12px;
背景色:#bbb;
边界半径:50%;
显示:内联块;
}
/*设置输入字段的样式*/
输入[类型=文本]{
宽度:100%;
边界半径:3px;
边界:无;
背景色:白色;
利润上限:-8px;
高度:25px;
颜色:#666;
填充物:5px;
}
.酒吧{
宽度:17px;
高度:3倍;
背景色:#aaa;
保证金:3px0;
显示:块;
}
/*页面内容*/
.内容{
填充:10px;
}
主唱
=>你的字典:
//这就是你的字典要去的地方!
=>研究清单:
//这就是你的字典要去的地方!
我想问的是关于这些地方:
<div class="content"><div class="scriptcontainer"> <script>//This is the place I want python terminal to be!</script>
//这就是我想要python终端的地方!
我希望这个地方像python终端一样工作。当页面加载时,它将运行程序,它不会影响任何其他事情,并像一个独立的事情,但它将留在页面上,并将是交互式的
这可能吗?如果可能,怎么可能
谢谢大家! 你到底想在这里做什么?如果您真的想用HTML运行python脚本,那么就使用CGI。由于您无法直接运行python,因此可能必须使用以下命令:
http://karrigell.sourceforge.net/en/pythoninsidehtml.html
或
但最好的方法是使用python cgi编程https://www.tutorialspoint.com/python/python_cgi_programming.htm
这是不可能的
我以前也有过这个问题。显然,目的是为其他脚本腾出空间,至少我这样认为:
它需要一个浏览器来实现这一点。可能是这个引擎:web上有些地方提供Python(和其他)REPL。你可以检查一下。我打赌其中一些甚至有github页面。否则,这就太宽了。很好的个人资料图片埃尔维斯。不幸的是,尽管他是一个不厌其烦的粉丝。我同意这个问题不属于这个问题,就像@jdv所说的那样。祝你好运,保重,老兄!在重读这个问题时,我突然想到,这可能是一个问题,因为你们要求解决一个假设的问题,但我们真的不知道为什么。看见你想做什么,你尝试了什么,你得到了什么结果?@RannLifshitz谢谢,但我不明白为什么人们总是告诉我我的问题不适合这么做。我只是被卡住了,我在网上搜索的东西,所以通常不会给我正确的答案。因此,我唯一的选择就是提问。Elvez——正如@jdv所说,有一个专门的线程,关于如何向So提问:不遵守这个标准可能会导致其他So用户的反对票。这不是针对个人的,而是一种协议的实施,该协议帮助来自多个国家的个人相互交流。祝你好运,伙计。我真的希望有人能用一句话来回答:“CGI。”谢谢!我想这就是我想要的。
http://www.skulpt.org/