Comments (2)
Hi Kiko,
For a basic script such as
print("ok")
Brython generates this code:
var $B = __BRYTHON__;
var _b_ = __BRYTHON__.builtins;
var $locals = $locals___main__
$locals___main__.__package__ = ""
$locals.__annotations__ = $B.empty_dict()
var $top_frame = ["__main__", $locals___main__, "__main__", $locals___main__]
$locals.$f_trace = $B.enter_frame($top_frame)
var $stack_length = $B.frames_stack.length;
try{
;$locals.$line_info = "1,__main__";if($locals.$f_trace !== _b_.None){$B.trace_line()};_b_.None;
$B.$call(_b_.print)("ok");
$B.leave_frame({$locals, value: _b_.None})
}
catch(err){
$B.leave_frame({$locals, value: _b_.None})
throw err
}
In the third line, the code needs a reference to $locals___main__
. In the Brython execution environment, this variable is initialized to an empty Javascript object. Here is a simplified version:
var $locals___main__ = {}
eval(js_code)
I suppose that setting this value in the brythonmagic environment would remove the error message.
from brythonmagic.
Thanks @PierreQuentel
I would give a try!!!!
Thanks for helping on this.
Salut!!
from brythonmagic.
Related Issues (17)
- js lib is not loaded when brython script is executed HOT 3
- Javascript Errors in HighCharts tutorial HOT 4
- Question HOT 2
- broken package? HOT 4
- DeprecationWarning: `should_run_async` will not call `transform_cell` HOT 1
- Does print() work ? HOT 2
- -f example with alert does not work
- Gist/Fiddle option is not working
- Highchart graphs not displaying
- not compatible with ipython 2.0 HOT 5
- brythonmagic can't import brython modules
- Problems on IPython notebook 2.3 HOT 5
- stop button is not working in a nb example HOT 1
- In the Highcharts nb example, the 3d example is not working properly HOT 1
- how to use Highstocks with brythonmagic? HOT 2
- http -> https HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brythonmagic.