File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ <h1>Python</h1>
3636 </ script >
3737 </ wc-code >
3838
39+ < h1 > Python example 2</ h1 >
40+ < p > Python code example here</ p >
41+ < wc-code mode ="python " file-name ="python-file.py ">
42+ < script type ="wc-content ">
43+ for a in range ( 100 ) :
44+ print ( a , a + 5 , 5 * a )
45+ </ script >
46+ </ wc-code >
47+
3948 < h1 > Code Zones !</ h1 >
4049 < p > javascript code zone</ p >
4150 < wc-code-zone mode ="javascript " theme ="blackboard ">
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ ${webcomponent.value}`)
4747 }
4848
4949 setPrintFn ( ) {
50- pyodide . runPython ( `
50+ this . subInterpreter . run ( `
5151def print(*args):
5252 from js import WCCode
5353 zone = WCCode.zones.get(${ this . zone . zoneId } )
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ WCCode.WCCode = class extends WCCodeMirror {
9595
9696 async initLanguage ( ) {
9797 this . loadingBar . setText ( 'initializing language...' )
98- if ( ! this . languageOptions . initilalized ) {
98+ if ( ! this . languageOptions . initialized ) {
9999 // if the language has an init function,
100100 // init it !
101101 if ( this . languageOptions . init ) {
@@ -114,7 +114,7 @@ WCCode.WCCode = class extends WCCodeMirror {
114114 async initInterpreter ( ) {
115115 // create the interpreter
116116 if ( this . parentZoneElement ) {
117- if ( ! this . parentZoneElement . initilalized ) this . parentZoneElement . init ( )
117+ if ( ! this . parentZoneElement . initialized ) this . parentZoneElement . init ( )
118118 } else {
119119 const interpreter = new this . languageOptions . Interpreter ( this . zone )
120120 this . zone . setInterpreter ( interpreter )
You can’t perform that action at this time.
0 commit comments