-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathclient.py
More file actions
53 lines (43 loc) · 992 Bytes
/
Copy pathclient.py
File metadata and controls
53 lines (43 loc) · 992 Bytes
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
48
49
50
51
52
53
#
# https://realpython.com/python-modules-packages/
#
# sys.path.append(r'C:\Users\john')
import mod
print("mod: ", mod)
print(mod.s)
print(mod.a)
mod.foo(['one', 'two', 'three'])
x = mod.Foo()
print(x)
import sys
print(sys.path)
print("mod.__file__: ", mod.__file__)
import re
print("re.__file__: ", re.__file__)
s = "local s"
print("s: ", s)
from mod import s
print("s: ", s)
from mod import s as alt_s
print("alt_s: ", alt_s)
import mod as alt_mod
print("alt_mod.s, ", alt_mod.s)
print("dir(): ", dir())
print("dir(mod): ", dir(mod))
from fact import fact
print("fact(6): ", fact(6))
print("<<import mod again (no additional output)")
import mod
import mod
print("import mod again (no additional output)>>")
print("<<import mod again (with reload)")
import importlib
importlib.reload(mod)
print("import mod again (with reload)>>")
print("pkg sample")
import pkg.mod1, pkg.mod2
# import pkg
pkg.mod1.foo()
print("pkg.mod2.Bar(): ", pkg.mod2.Bar())
from pkg.mod1 import foo
foo()