4 Star 13 Fork 6

AliOS Things / haas_lib_bundles_python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
sys.md 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
skylarCai 提交于 2022-01-05 20:11 . release version:rel_3.3.0-20211220_1000

sys - 系统相关功能

  • 模块功能:
    sys 模块中提供了与HaaS Python运行环境有关的函数和变量。

  • 常量说明

常量定义 常量说明
sys.argv 当前程序启动的可变参数列表
sys.byteorder 字节顺序 (‘little’ - 小端, ‘big’ - 大端)
sys.implementation 当前microPython版本信息
- name - 字符串“ micropython”
- version - 元组(主要,次要,微型),例如(1、7、0)
sys.maxsize 本机整数类型可以在当前平台上保留的最大值
sys.modules 已载入模块的字典
sys.platform 当前MicroPython运行的平台
sys.stdin 标准输入
sys.stdout 标准输出
sys.version MicroPython 语言版本,字符串格式。
sys.version_info MicroPython 语言版本,整数元组格式

exit - 退出当前程序

  • 函数原型:

sys.exit(retval=0)

  • 函数功能:
    使用给定的参数退出当前程序。与此同时,该函数会引发SystemExit退出。如果给定了参数,则将其值作为参数赋值给SystemExit

  • 参数说明:

参数 类型 必选参数? 说明
retval int 程序退出的返回值

print_exception - 打印异常信息

  • 函数原型:

sys.print_exception(exc, file=sys.stdout)

  • 函数功能: 打印异常到文件对象,默认是打印到sys.stdout(输出异常信息的标准输出)。
1
https://gitee.com/alios-things/haas_lib_bundles_python.git
git@gitee.com:alios-things/haas_lib_bundles_python.git
alios-things
haas_lib_bundles_python
haas_lib_bundles_python
master

搜索帮助