From 1729c5b6cad3fb11073f270740c659afd2b3e1a1 Mon Sep 17 00:00:00 2001 From: Lyon <88232613+mimilib@users.noreply.github.com> Date: Fri, 27 Aug 2021 16:13:49 +0800 Subject: [PATCH] =?UTF-8?q?Update=203.PikaScript=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=B5=81=E7=A8=8B.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/3.PikaScript标准开发流程.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/3.PikaScript标准开发流程.md b/doc/3.PikaScript标准开发流程.md index 4e706e75b..3bdbb0d60 100644 --- a/doc/3.PikaScript标准开发流程.md +++ b/doc/3.PikaScript标准开发流程.md @@ -74,4 +74,8 @@ print('mem used now:') mem.now() ``` +导入一个已经编写好的类包是非常简单的,比如导入Device包,只需要`import Device`即可,要注意的是所有的.py文件应当放在pikascript文件架的根目录下。 +然后使用Device中的LED类新建对象,只需要写一句`uart = Device.Uart()`即可,这表示新建一个`uart`对象,这个对象的类是Device包中的Uart类。 + +调用方法则使用`uart.setName('com')`这种形式,这都是Python的标准语法,不需要过多介绍。