FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vcs/_4.python/function/function1_file1.py at master · bunshue/vcs · GitHub
bunshue
/
vcs
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
3
Code
Issues
0
Pull requests
4
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
vcs
/
_4.python
/
function
/
function1_file1.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (28 loc) · 894 Bytes
Breadcrumbs
vcs
/
_4.python
/
function
/
function1_file1.py
Copy path
File metadata and controls
47 lines (28 loc) · 894 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
41
42
43
44
45
46
47
print
(
"自定義函數, 寫在另一個檔案裏面"
)
# 位置 檔案名
from
module_files
import
draw_bar
draw_bar
.
draw
(
10
,
"$"
)
draw_bar
.
draw
(
6
,
"#"
)
draw_bar
.
draw
(
15
)
from
module_files
import
my_print
# 把整個 my_print.py 都引進來
print
(
"測試導入自定義模組"
)
my_print
.
print_func
(
"Python"
)
from
module_files
import
calculate
# 匯入 calculate 模組
print
(
calculate
.
add
(
5
,
2
))
# 7
print
(
calculate
.
sub
(
5
,
2
))
# 3
"""
from calculate import add,sub
print(add(5,2)) # 7
print(sub(5,2)) # 3
from calculate import add
print(add(5,2)) # 7
print(sub(5,2)) # NameError: name 'sub' is not defined
from calculate import *
print(add(5,2)) # 7
print(sub(5,2)) # 3
from calculate import add as a
print(a(5,2)) # 7
import calculate as cal # 匯入 calculate 模組,並取別名為 cal
print(cal.add(5,2)) # 7
print(cal.sub(5,2)) # 3
"""
Back
|
FazBrowse Home
|
New Git URL