-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
timeface
authored and
timeface
committed
Oct 31, 2018
1 parent
476439e
commit 40be29e
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
''' | ||
tell the python interpreter to find your module | ||
>>> import sys | ||
>>> sys.path.append("absolute_path/your_module_dir") | ||
import-only-once !!!! 模块的缓存 | ||
>>> import importlib | ||
>>> hello = importlib.reload(hello) | ||
''' | ||
|
||
def greet(): | ||
print('hello world') | ||
|
||
|
||
if __name__ == "__main__": | ||
## 不是被别的模块import | ||
## 而是被当做程序执行 | ||
greet() |