blueloveTH 1 rok pred
rodič
commit
b82b3702e2
4 zmenil súbory, kde vykonal 10 pridanie a 6 odobranie
  1. 1 0
      README.md
  2. 3 0
      docs/index.md
  3. 4 4
      docs/retype.yml
  4. 2 2
      src/public/modules.c

+ 1 - 0
README.md

@@ -30,6 +30,7 @@ Developers are able to write Python bindings via C-API or pybind11 compatible in
 
 Please see https://pocketpy.dev for details and try the following resources.
 + [Live Python Demo](https://pocketpy.dev/static/web/): Run Python code in your browser
++ [Live C Examples](https://pocketpy.github.io/examples/): Explore C-APIs in your browser
 
 ## Supported Platforms
 

+ 3 - 0
docs/index.md

@@ -10,6 +10,9 @@ It aims to be an alternative to Lua for game scripting, with elegant syntax, pow
 pocketpy has no dependencies other than the C standard library, which can be easily integrated into your C/C++ project.
 Developers are able to write Python bindings via C-API or pybind11 compatible interfaces.
 
++ [Live Python Demo](https://pocketpy.dev/static/web/): Run Python code in your browser
++ [Live C Examples](https://pocketpy.github.io/examples/): Explore C-APIs in your browser
+
 ## What it looks like
 
 ```python

+ 4 - 4
docs/retype.yml

@@ -16,14 +16,14 @@ links:
     icon: play
     link: "https://pocketpy.dev/static/web/"
     target: blank
+  - text: "Live Examples"
+    icon: code
+    link: "https://pocketpy.github.io/examples/"
+    target: blank
   - text: "Github"
     icon: mark-github
     link: https://github.com/blueloveth/pocketpy
     target: blank
-  - text: Issues
-    link: https://github.com/blueloveth/pocketpy/issues
-    icon: issue-opened
-    target: blank
   - text: Discord
     link: https://discord.gg/WWaq72GzXv
     icon: comment-discussion

+ 2 - 2
src/public/modules.c

@@ -619,8 +619,8 @@ static bool builtins_eval(int argc, py_Ref argv) {
 static bool
     pk_smartexec(const char* source, py_Ref module, enum py_CompileMode mode, va_list args) {
     if(module == NULL) module = &pk_current_vm->main;
-    py_newglobals(py_pushtmp());  // globals
-    py_newdict(py_pushtmp());     // locals
+    pk_mappingproxy__namedict(py_pushtmp(), module);  // globals
+    py_newdict(py_pushtmp());                         // locals
     bool ok = py_compile(source, "<string>", mode, true);
     if(!ok) return false;
     py_push(py_retval());