-
Notifications
You must be signed in to change notification settings - Fork 0
/
package
35 lines (24 loc) · 841 Bytes
/
package
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
folder_name
__init__.py
script-1.py
script-2.py
**************************************************************************************************************
in __init__.py file:
from .script-1 import *
from .script-2 import *
__all__ = (script-1.__all__ +
script-2.__all__)
**************************************************************************************************************
in script-1.py file:
__all__ = ['MyClass'] # MyFunction will not be accessible
class MyClass:
pass
def MyFunction():
pass
**************************************************************************************************************
in script-2.py file:
__all__ = ['fun_1'] # fun_2 will not be accessible
class fun_1:
pass
def fun_2():
pass