Python之compiler:compiler库的简介、安装、使用方法之详细攻略
目录
根据文件名自动编译运行程序,基于文件类型平台自动编译代码:: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: Natural Language :: English Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Requires-Python: >=3
主页:https://github.com/xiaojieluo/vlde
pip install compiler
- 使用
- from vlde import Validator
-
- v = Validator(return_format='object')
- result = v.set_rules('hello', 'required|dict|max_length:3')
- if result.status is False:
- print('\n'.join(result.error))
- 或者捕获异常:
-
- from vlde import ValidateError, Validator
-
- v = Validator(return_format='exception')
- try:
- v.set_rules('hello', 'required|dict')
- except ValidateError as e:
- print(e)
网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。
添加我为好友,拉您入交流群!
请使用微信扫一扫!