Created
May 22, 2016 01:46
-
-
Save 28sui/80df6a025a20cfe4f9b90917b8ea16b0 to your computer and use it in GitHub Desktop.
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
import string | |
print(string) | |
import os | |
import imp | |
(filepath,tempfilename) = os.path.split(os.__file__) | |
string=imp.load_source('string',filepath+'/string.py') | |
print(filepath) | |
print(string) | |
#result | |
<module 'string' from '/Volumes/nan/Desktop/string.py'> | |
/Volumes/nan/.pyenv/versions/3.5.1/lib/python3.5 | |
<module 'string' from '/Volumes/nan/.pyenv/versions/3.5.1/lib/python3.5/string.py'> | |
<module 'string' from '/Volumes/nan/.pyenv/versions/3.5.1/lib/python3.5/string.py'> | |
/Volumes/nan/.pyenv/versions/3.5.1/lib/python3.5 | |
<module 'string' from '/Volumes/nan/.pyenv/versions/3.5.1/lib/python3.5/string.py'> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment