Skulpt는 웹 브라우저에서 동작하는 Python입니다.
정말, 제대로 미친 것 같지만 멋지네요.
위 예제와 같은 터미널은 다음과 같이 작성할 수 있습니다.
 
[code:js]
window.addEvent('domready', function() {
    var term = initTerminal(80, 20);
 
    // set up demo typers
    $('codeexample1').addEvent('click', (function(e)
            {
                e.stop();
                term.doClear();
                term.writeStr("print \"Hello, World!\"     # natch", false, true);
                term.doEnter();
            }));
    $('codeexample2').addEvent('click', (function(e)
            {
                e.stop();
                term.doClear();
                term.writeStr("for i in range(5):", false, true); term.doEnter();
                term.writeStr("    print i", false, true); term.doEnter();
                term.doEnter();
            }));
    $('codeexample3').addEvent('click', (function(e)
            {
                e.stop();
                term.doClear();
                term.writeStr("[x*x for x in range(20) if x % 2 == 0]", false, true);
                term.doEnter();
            }));
 
    term.writeStr("Skulpt demo REPL - " + new Date().toLocaleString() + "\n");
    term.writeStr(term.PS1, true);
});
from Skulpt: Crazy project that lets your browser parse and run Python
 


Posted by 행복한고니 트랙백 0 : 댓글 1

티스토리 툴바