Files
luban-lite-t3e-pro/packages/third-party/micropython-1.13.0/docs/std-librarys/uerrno.md
2025-09-30 11:56:06 +08:00

21 lines
573 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## **uerrno** 系统错误码模块
`uerrno` 模块提供了标准的 errno 系统符号,每个符号都有对应的整数值。
### 示例
```python
try:
uos.mkdir("my_dir")
except OSError as exc:
if exc.args[0] == uerrno.EEXIST:
print("Directory already exists")
uerrno.errorcode
Dictionary mapping numeric error codes to strings with symbolic error code (see above):
>>> print(uerrno.errorcode[uerrno.EEXIST])
EEXIST
```
更多内容可参考 [uerrno](http://docs.micropython.org/en/latest/pyboard/library/uerrno.html) 。