Compare commits

..

No commits in common. "aa03544d4bb750c77531d20205f10c8eadcc229f" and "b6a6aa85a6cbfe0427b48e523d53ee3832bf5bd2" have entirely different histories.

5 changed files with 17 additions and 30 deletions

View File

@ -32,8 +32,6 @@ 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
+ [Godot Extension](https://github.com/pocketpy/godot-pocketpy): Use pocketpy in Godot Engine
+ [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy): Debug and profile pocketpy scripts in VSCode
+ [Flutter Plugin](https://pub.dev/packages/pocketpy): Use pocketpy in Flutter apps
## Supported Platforms

View File

@ -1,11 +1,24 @@
---
icon: dot
title: Debugging
order: 80
---
## VSCode Extension
!!!
This feature is not available in `v2.0` yet.
!!!
You can install our VSCode extension to debug pocketpy scripts.
You can invoke `breakpoint()` in your python code to start a PDB-like session.
https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy
The following commands are supported:
+ `h, help`: show this help message
+ `q, quit`: exit the debugger
+ `n, next`: execute next line
+ `s, step`: step into
+ `w, where`: show current stack frame
+ `c, continue`: continue execution
+ `a, args`: show local variables
+ `l, list`: show lines around current line
+ `ll, longlist`: show all lines
+ `p, print <expr>`: evaluate expression
+ `!, execute statement`: execute statement

View File

@ -1,23 +0,0 @@
---
icon: dot
title: Profiling
order: 79
---
To profile your pocketpy program, you can run `main.exe` with `--profile` flag.
For example, to profile `test/test_math.py`, run
```
main.exe --profile test/test_math.py
```
This will output a JSON report file named `profile_report.json` in the current directory,
which records the time spent for each line. To visualize the report, please install our VSCode extension.
https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy
With pocketpy VSCode extension, press `F1` and type `pocketpy: Load Line Profiler Report`,
select **1. the `profile_report.json` file; 2. the source root of the program**. Then you will see a nice visualization of the profiling result.
![lp](../static/profiler_demo.png)

View File

@ -13,7 +13,6 @@ Developers are able to write Python bindings via C-API or pybind11 compatible in
+ [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
+ [Godot Extension](https://github.com/pocketpy/godot-pocketpy): Use pocketpy in Godot Engine
+ [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy): Debug and profile pocketpy scripts in VSCode
+ [Flutter Plugin](https://pub.dev/packages/pocketpy): Use pocketpy in Flutter apps
## What it looks like

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 KiB