Last active
February 6, 2018 21:25
-
-
Save stigok/f9367d682a0dcdf5655a3cb51584f6f7 to your computer and use it in GitHub Desktop.
Python 3: how to import methods from a different file in same folder
This file contains hidden or 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
def test(): | |
print("Test method") | |
if __name__ == "__main__": | |
print("Main method") |
This file contains hidden or 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
from file1 import test as test_method | |
print("Hello, world!") | |
test_method() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment