Skip to content

Commit bf6dc15

Browse files
authored
练习python的模块
1 parent bed0733 commit bf6dc15

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test15.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
' a test module '
5+
6+
__author__ = 'sergiojune'
7+
8+
9+
# 上面是一个模块的正确写法
10+
# 第一个注释是可以将这个代码直接运行在Unix/Linux/Mac上
11+
# 第二行代码是说这个代码是以utf-8编写的
12+
# 第三代码就是模块的文档注释
13+
# 第四行代码就是作者标明
14+
15+
import sys
16+
# 添加自己模块的查找位置,这样的方法当运行完就失效,可以想一直有用可以添加环境变量
17+
sys.path.append(r'E:\anaconda\python_project')
18+
# 导入自己的模块
19+
import spider_ip

0 commit comments

Comments
 (0)