File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/visualizers/widgets/TensorPlotter Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ define([
3030 constructor ( logger , container ) {
3131 super ( container ) ;
3232 this . _logger = logger . fork ( 'Widget' ) ;
33+ this . cmdCount = 0 ;
3334 this . currentPlotData = null ;
3435
3536 this . session = null ;
@@ -95,8 +96,10 @@ define([
9596
9697 async execPy ( code ) {
9798 try {
98- await this . session . addFile ( 'last_cmd.py' , code ) ;
99- const { stdout} = await this . session . exec ( 'python last_cmd.py' ) ;
99+ const i = ++ this . cmdCount ;
100+ await this . session . addFile ( `cmd_${ i } .py` , code ) ;
101+ const { stdout} = await this . session . exec ( `python cmd_${ i } .py` ) ;
102+ await this . session . removeFile ( `cmd_${ i } .py` ) ;
100103 return stdout ;
101104 } catch ( err ) {
102105 const { stderr} = err . jobResult ;
You can’t perform that action at this time.
0 commit comments