Skip to content

Commit e635c2e

Browse files
author
QueenieCplusplus
committed
to push a pkg
1 parent be67bfc commit e635c2e

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

QsPKG/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# this is an empty file
2+
# aims at declare the QSPKG as a package
3+
4+
# 空檔案
5+
# 目的是要宣告上層工具包為一個工具包
6+
7+
# 方便外部使用時
8+
# from QSPKG.qsModule import

QsPKG/qsModule.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 0216, by QueenPy
2+
# this is a file as Module
3+
# under a folder (root) as PKG
4+
5+
6+
def qs_func():
7+
res = 'Hi this Func Res'
8+
print(res)
9+
10+
# Main Thread in Life cycle
11+
if __name__ == '__main__':
12+
qs_func()

QsPKG/qsModule.pyc

355 Bytes
Binary file not shown.

QsPKG/to_import_a_module.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# to import a module, using its class | func
2+
3+
from .qsModule import qs_func
4+
# relative import
5+
# 相對引入導入
6+
# from module_name (file name) import class name
7+
# from module_name (file name) import func name
8+
9+
if __name__ == '__main__':
10+
qs_func()

0 commit comments

Comments
 (0)