-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathdemo.py
41 lines (31 loc) · 1.05 KB
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: UTF-8 -*-
################################################################################
#
# Copyright (c) 2021 Baidu.com, Inc. All Rights Reserved
#
################################################################################
"""
本文件实现了一个hello world的demo类。
Authors: zhoujingbo([email protected])
Date: 2021/10/19 10:30:45
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
class Hello(object):
"""hello world类"""
def run(self, name="World", *args):
"""主入口方法。
根据百度python编码规范,注释应当使用google风格。
可以使用sphinx配合napoleon扩展插件自动生成文档。
Args:
name: 名称
Returns:
int类型,执行结果,0表示成功
Raises:
ValueError: 参数name的取值不合法
"""
if not name:
raise ValueError(name)
print("Hello {0}!".format(name))
return 0