Skip to content

Commit 28b82f3

Browse files
committed
【添加】基本类型模块示例
1 parent 776a108 commit 28b82f3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

examples/basic/_thread.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2006-2019, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: MIT License
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2019-06-13 SummerGift first version
9+
*/
10+
11+
import _thread
12+
import utime as time
13+
14+
def testThread():
15+
while True:
16+
print("Hello from thread")
17+
time.sleep(2)
18+
19+
_thread.start_new_thread(testThread, ())
20+
while True:
21+
pass

examples/basic/uos.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2006-2019, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: MIT License
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2019-06-13 SummerGift first version
9+
*/
10+
11+
import uos
12+
13+
uos.mkdir("rtthread")
14+
uos.getcwd()
15+
uos.chdir("rtthread")
16+
uos.getcwd()
17+
uos.listdir()
18+
uos.rmdir("11")
19+
uos.listdir()
20+

0 commit comments

Comments
 (0)