当前位置:   article > 正文

python3在线工具-Skulpt在线模拟运行Python工具

python3模拟器在线

function outf(text) {

var mypre = document.getelementbyid("output");

mypre.innerhtml = mypre.innerhtml + text;

}

function builtinread(x) {

if (sk.builtinfiles === undefined || sk.builtinfiles["files"][x] === undefined)

throw "file not found: '" + x + "'";

return sk.builtinfiles["files"][x];

}

function runit() {

var prog = document.getelementbyid("yourcode").value;

var mypre = document.getelementbyid("output");

mypre.innerhtml = '';

sk.pre = "output";

sk.configure({ output: outf, read: builtinread, __future__: sk.python3});

(sk.turtlegraphics || (sk.turtlegraphics = {})).target = 'mycanvas';

var mypromise = sk.misceval.asynctopromise(function() {

return sk.importmainwithbody("", false, prog, true);

});

mypromise.then(function(mod) {

console.log('success');

},

function(err) {

console.log(err.tostring());

});

}

try this

import turtle

print('hello')

t = turtle.turtle()

t.color('red')

t.forward(75)


run

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/643223
推荐阅读
相关标签
  

闽ICP备14008679号