File tree 3 files changed +8
-9
lines changed
3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 8
8
< h1 > RustPython Demo</ h1 >
9
9
< p >
10
10
RustPython is a Python interpreter writter in Rust. This demo is
11
- compiled from Rust to WebAssembly so it runs in the browser.
12
- </ p >
13
- < p >
11
+ compiled from Rust to WebAssembly so it runs in the browser. < br />
14
12
Please input your python code below and click < kbd > Run</ kbd > , or you
15
- can up your browser's devtools and play with
13
+ can open up your browser's devtools and play with
16
14
< code > rp.pyEval('print("a")')</ code >
17
15
</ p >
18
16
< textarea id ="code ">
@@ -27,7 +25,6 @@ <h1>RustPython Demo</h1>
27
25
print(n1)
28
26
n1, n2 = n2, n1 + n2
29
27
count + = 1
30
-
31
28
</ textarea
32
29
>
33
30
< button id ="run-btn "> Run ▷</ button >
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ function runCodeFromTextarea() {
33
33
const result = rp . pyEval ( code , {
34
34
stdout : '#console'
35
35
} ) ;
36
- consoleElement . value += `\n${ result } \n` ;
36
+ if ( result !== null ) {
37
+ consoleElement . value += `\n${ result } \n` ;
38
+ }
37
39
} catch ( e ) {
38
40
errorElement . textContent = e ;
39
41
console . error ( e ) ;
Original file line number Diff line number Diff line change @@ -4,17 +4,17 @@ textarea {
4
4
}
5
5
6
6
# code {
7
- height : 35 vh ;
7
+ height : 30 vh ;
8
8
width : calc (100% - 3px );
9
9
}
10
10
11
11
.CodeMirror {
12
12
border : 1px solid # ddd ;
13
- height : 35 vh !important ;
13
+ height : 30 vh !important ;
14
14
}
15
15
16
16
# console {
17
- height : 35 vh ;
17
+ height : 30 vh ;
18
18
width : calc (100% - 3px );
19
19
}
20
20
You can’t perform that action at this time.
0 commit comments