# pikapython **Repository Path**: wint-memory/pikapython ## Basic Information - **Project Name**: pikapython - **Description**: PikaPython 是一个完全重写的超轻量级python引擎,零依赖,零配置,可以在少于4KB的RAM下运行(如stm32g030c8和stm32f103c8),极易部署和扩展 - **Primary Language**: C - **License**: MIT - **Default Branch**: master - **Homepage**: http://pikascript.com/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 233 - **Created**: 2023-06-13 - **Last Updated**: 2023-06-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
论坛 | 文档中心 | 视频 | 开发板 | BSP | 包管理器 | RT-Thread 软件包 | 参与贡献 | 商业合作
[](https://pikastech.github.io/PikaPython/dev/bench/) # 1.简介 PikaPython 是一个完全重写的超轻量级 python 引擎,零依赖,零配置,可以在 **Flash ≤ 64KB,RAM≤ 4KB** 的平台下运行(如 stm32g030c8 和 stm32f103c8),极易部署和扩展,具有大量的中文文档和视频资料。 PikaPython 也称 PikaScript、PikaPy。
PikaPython 具有框架式 C 模块开发工具,只要用 Python 写好调用 API ,就能够自动连接到 C 模块,非常方便快捷。不用手动处理任何全局表、宏定义、等等。
PikaPython 也支持 MDK、iar、RT-studio 等常见 ide 开发,能够轻松地调试 C 模块。
# 最新资讯
- [📢 发布公告:PikaPython v1.12.2 发布 🚀](https://mp.weixin.qq.com/s?__biz=MzU4NzUzMDc1OA==&mid=2247484789&idx=1&sn=bedfc580932a4bd286264110a065de2a&chksm=fdebd21cca9c5b0a4654a394f48fb3cb0e743b4ad72fef4d96e4cf28fa4357349b4862f0be7e&token=2116766907&lang=zh_CN#rd)
- [万元结项奖金!学生报名开启!PikaPython 开源之夏 2023](https://mp.weixin.qq.com/s?__biz=MzU4NzUzMDc1OA==&mid=2247484785&idx=1&sn=1cf983057765198f53c4f6c8aa04e516&chksm=fdebd218ca9c5b0e3444112a5a033dc295c63482bcb8934422a199784e900c2cd95f633da5b4&token=2116766907&lang=zh_CN#rd)
- [【喜报】PikaPython突破 1000+ Github Star,物联网与边缘AI领域的轻量级Python解释器再创新高!](https://mp.weixin.qq.com/s?__biz=MzU4NzUzMDc1OA==&mid=2247484773&idx=1&sn=e0273c1c55614ea11387d6f785c4bfb9&chksm=fdebd20cca9c5b1a14fef9c2cd90f01551ce0c04eac4de0759fdc8ba27ae4158a68ce1eb5a5f&token=2116766907&lang=zh_CN#rd)
- [PikaPython项目入选中国开源创新大赛决赛,携手共建国内开源生态](https://mp.weixin.qq.com/s?__biz=MzU4NzUzMDc1OA==&mid=2247484762&idx=1&sn=2b3e570bbc7e98874b6773fe8e2678c7&chksm=fdebd233ca9c5b255296db6e9874035577a02b6b26354c4c2a2298696a02ec467149ca91a078&token=2116766907&lang=zh_CN#rd)
- [轻量级Python解释器PikaPython成功入选开源之夏,探索无限可能!](https://mp.weixin.qq.com/s?__biz=MzU4NzUzMDc1OA==&mid=2247484738&idx=1&sn=7af1c9bb61e6decd5c155924cb7a05f8&chksm=fdebd22bca9c5b3d3f2fbd8742941e6c33e86cbcba88c329b0b9550b54b0291b6f50553d5eea&token=709915806&lang=zh_CN#rd)
- [2022 年 PikaPython 年终总结](https://mp.weixin.qq.com/s/cWtujWF8EuJnuXuVUeWNKw)
- [【快讯】PikaScript 合并进入 LVGL 主线文档,创始人Gabor 这样说...](https://mp.weixin.qq.com/s/2vcZfRfAAmAqPfyOm7CqUg)
# 获取 PikaPython:
## 使用在线图形化工程生成器
生成器地址:
http://pikascript.com
[](http://pikascript.com)
## 使用 Pika 包管理器[PikaPackage.exe](https://pikadoc.readthedocs.io/zh/latest/%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%E4%B8%8E%E6%A8%A1%E5%9D%97%E7%AE%A1%E7%90%86.html)
1. 直接运行[PikaPackage.exe](https://pikadoc.readthedocs.io/en/latest/%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%E4%B8%8E%E6%A8%A1%E5%9D%97%E7%AE%A1%E7%90%86.html), 自动下载并更新pikapython主仓库(文件在当前磁盘的/tmp/pikapython文件夹)
2. 将[requestment.txt](/bsp/stm32g070cb/pikapython/requestment.txt)放在[PikaPackage.exe](https://pikadoc.readthedocs.io/en/latest/%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%E4%B8%8E%E6%A8%A1%E5%9D%97%E7%AE%A1%E7%90%86.html)同一文件夹下, 运行[pikaPackage.exe](https://pikadoc.readthedocs.io/en/latest/%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%E4%B8%8E%E6%A8%A1%E5%9D%97%E7%AE%A1%E7%90%86.html), 自动在当前目录下安装[内核](../../tree/master/src)、[预编译器](../../tree/master/tools/pikaCompiler)与[模块](../../tree/master/package)。
3. 已发布的模块列表:[packages.toml](/packages.toml)
# 快速上手
可使用[仿真工程](document/1.三分钟快速上手.md)快速上手,无需硬件,也可以使用官方支持的开发板[Pika派—Zero](https://item.taobao.com/item.htm?spm=a2126o.success.result.1.76224831Y0X1gO&id=654947372034),上手即玩。
[Pika派python编程游玩指南](https://pikadoc.readthedocs.io/zh/latest/Pika%20%E6%B4%BE%E5%BC%80%E5%8F%91%E6%9D%BF%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B.html)
[](https://item.taobao.com/item.htm?spm=a2126o.success.result.1.76224831Y0X1gO&id=654947372034)
开发板基于 STM32G030C8T6 小资源 MCU,仅 64kB Flash,8kB RAM 即可运行完整解释器,和完整的外设驱动(GPIO、TIME、IIC、UART、ADC、PWM、RGB、KEY、LCD)。板载 CH340 USB 转串口芯片,Type-C 接口,支持串口下载 python 脚本,板载4颗 RGB 灯,可选配[LCD屏幕](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-23991764791.12.16f97c58fsLjVk&id=660745643102)。
# 开发手册
### [点此进入文档中心](http://pikascript.com/doc)

# 视频教程
### [点此进入视频中心](https://space.bilibili.com/5365336/channel/seriesdetail?sid=1034902)

# 交流论坛
### [点此进入论坛](https://whycan.com/f_55.html)

## 文件目录
[src](../../tree/master/src) - 内核源码
[bsp](../../tree/master/bsp) - 裸机芯片/板卡支持
[port](../../tree/master/port) - 操作系统和包管理器支持
[test](../../tree/master/port/linux/test) - 单元测试
[document](../../tree/master/document) - 开发文档
[examples](../../tree/master/examples) - 示例脚本
[package](../../tree/master/package) - 模块目录
[pikaCompiler](../../tree/master/tools/pikaCompiler) - 使用 rust 编写的预编译器
[pikaPackageManager](../../tree/master/tools/pikaPackageManager) - 使用 go 编写的模块管理器
# 2.平台支持列表
## MCU support
|MCU |bsp|gpio|time|uart|pwm|adc|i2c|dac|
|--- |---|--- |--- |--- |---|---|---|---|
|stm32g030c8 |√ |√ |√ |√ |√ |√ |√ | |
|stm32g070cB |√ |√ |√ |√ |√ |√ |√ | |
|stm32f103c8 |√ |√ |√ |√ |√ |√ |√ | |
|stm32f103rb |√ |√ |√ |√ |√ |√ |√ | |
|stm32f103ze |√ |√ |√ |√ |√ |√ |√ | |
|stm32f103rc |√ |√ |√ |√ |√ |√ |√ | |
|stm32f401cc |√ |√ |√ |√ |√ |√ |√ | |
|stm32f411ce |√ |√ |√ |√ |√ |√ |√ | |
|stm32f407ze |√ | | | | | | | |
|stm32f407zg |√ | | | | | | | |
|stm32h750vb |√ | | | | | | | |
|stm32f051r8 |√ | | | | | | | |
|air32f103cb |√ |√ |√ | | | | | |
|ch582 |√ |√ |√ |√ | |√ |√ | |
|ch32v103r8t6 |√ |√ |√ | | | | | |
|cm32m101a |√ | | | | | | | |
|w806 |√ |√ |√ |√ |√ |√ |√ | |
|apm32f030r8 |√ | | | | | | | |
|apm32e103vb |√ | | | | | | | |
|bl-602 |√ |√ | | |√ |√ | |√ |
|bl-706 |√ | | | | | | | |
|[bl-618](https://verimake.com/d/285-bl618-pikapython-led)|√ | √ | √ | √ | √ | √ | √ | √ |
|Raspberry Pico |√ | | | | | | | |
|ESP32C3 |√ |√ |√ | | | | | |
|TC264D |√ | | | | | | | |
|devc |√ | | | | | | | |
|visual-studio |√ | | | | | | | |
|EC600N |√ | | | | | | | |
|mm32f5277e9p |√ |√ | | | | | | |
|xr806(openharmony)|√ | | | | | | | |
## Board support
|Board|bsp|gpio|uart|pwm|adc|i2c|rgb|lcd|arm-2d|
|---|---|---|---|---|---|---|---|---|---|
|[Pika-Pi-Zero](https://item.taobao.com/item.htm?spm=a230r.1.14.1.4f2e27a8R0qWJn&id=654947372034&ns=1&abbucket=15#detail)|√|√|√|√|√|√|√|√|√|
|Board|bsp|pika_lvgl|
|---|---|---|
|lvgl-vs-simu|√|√|
|swm320|√|√|
|Board|bsp|arm-2d|
|---|---|---|
|QEMU-arm2d|√|√|
|Board|bsp|LED|KEY|
|---|---|---|---|
|SmartLoong|√|√|√|√|
## OS support
|OS|port|GPIO|TIME|PWM|
|---|---|---|---|---|
|RT-Thread|√|√|√|√|
|vsf|√|√| | |
|OS|port|Google Test|Benchmark|
|---|---|---|---|
|linux|√|√|√|
## 相关开源项目
- ▶️ [pikapython Binding For LVGL](https://github.com/lvgl/lv_binding_pikascript)
- ⭐ [pikapython Bluepill Demo In PlatformIO — Python-like REPL 🐍🔌](https://github.com/maxgerhardt/pikascript-pio-bluepill)
- ⭐ [pikapython Bluepill Demo In GCC 🐍](https://github.com/Chandler-Kluser/pikascript_gcc_bluepill)
# 3.特性
### (1)运行环境
支持裸机运行,可运行于 **RAM ≥ 4kB** ,**FLASH ≥ 64kB** 的mcu中,如stm32g030, stm32f103c8t6,esp8266。
### (2)开发环境
支持串口下载 Python 脚本。


|
| 千帆(微信名) |
|
| [ Meco Jianting Man](https://github.com/mysterywolf) | 




|
| [liuduanfei](https://github.com/liuduanfei) |
|
| [ sjy](https://gitee.com/shanjiayang) | 
|
| 沧御 |
|
| [versaloon](https://github.com/versaloon) | 
|
| 刘延(微信名) | 
|
| [GorgonMeducer](https://github.com/GorgonMeducer) | 



|
| [unsigned](https://gitee.com/unsigned0) | 
|
| [梦程MI](https://gitee.com/dreamcmi) | 

|
| [Maximilian Gerhardt](https://github.com/maxgerhardt) |
|
| [purewind7](https://gitee.com/purewind7) | 


|
| [ onceday](https://gitee.com/onceday) | 
|
### 贡献记录 (2023 年)
| 贡献记录 | 贡献者 |
| --- | --- |
|Fixed a bug where help("modules") crashed when no lib was loaded|[梦程MI](https://gitee.com/dreamcmi) |
|support GPIO driver for rt-thread| [supperthomas](https://github.com/supperthomas) |
|Fixed a typo|[J. Neuschäfer](https://github.com/neuschaefer)|
|codecov CI support| [Renzhihan](https://github.com/Renzhihan) |
|rt-thread build script fix and improve| [supperthomas](https://github.com/supperthomas) |
|support pikafs pack and unpack to path|[sjy](https://gitee.com/shanjiayang)|
|fix pika_platform_get_tick() in linux port|[梦程MI](https://gitee.com/dreamcmi) |
|CH307开发板、BL618开发板 | [VeriMake](https://space.bilibili.com/356383684) |
|VM instruction extension framework | [GorgonMeducer](https://github.com/GorgonMeducer) |
|iotcloud module|[梦程MI](https://gitee.com/dreamcmi) |
|implement shell filter | [GorgonMeducer](https://github.com/GorgonMeducer) |
|修复socket模块在lwip中fcntl的参数数量错误|[梦程MI](https://gitee.com/dreamcmi) |
|support GPIO pika_hal for BLMCU|[codercmd](https://gitee.com/codercmd)|
|Fix Typo on PikaVM.c|[Ikko Eltociear Ashimine](https://gitee.com/eltociear)|
|Fix type assert on dataArgs.c|[itschina](https://gitee.com/itschina)|
|add examples/Device/KEY_POLL.PY|[codercmd](https://gitee.com/codercmd)|
| hmac hashlib base64 aes modules | [梦程MI](https://gitee.com/dreamcmi) |
|fix pikaCompiler build error on macos|[梦程MI](https://gitee.com/dreamcmi) |