From 458f3c84a6950c7d85f226388cfecb4e68c24b38 Mon Sep 17 00:00:00 2001 From: BLUELOVETH Date: Tue, 6 Feb 2024 22:53:15 +0800 Subject: [PATCH] some doc fix --- docs/quick-start/exec.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/quick-start/exec.md b/docs/quick-start/exec.md index 310afa23..2af6a713 100644 --- a/docs/quick-start/exec.md +++ b/docs/quick-start/exec.md @@ -50,10 +50,10 @@ These two methods are provided for this purpose: ```cpp try{ - PyObject* result = vm->exec("123", "", EVAL_MODE); - std::cout << py_cast(vm, result); // 123 + CodeObject_ code = vm->compile("a[0]", "main.py", EXEC_MODE, false); + vm->_exec(code, vm->_main); }catch(Exception& e){ // use e.summary() to get a summary of the exception std::cerr << e.summary() << std::endl; } -``` \ No newline at end of file +```