diff --git a/tests/VariableName/ImportVarName.py b/tests/VariableName/ImportVarName.py new file mode 100644 index 0000000..7def4cd --- /dev/null +++ b/tests/VariableName/ImportVarName.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- + +# Python __name__ module ImportVarName +# Author - HoneyMoose(huyuchengus@gmail.com) +# Link Article - https://www.ossez.com/t/python-name/13393 + + +print("ImportVarName __name__ = %s" % __name__) + +if __name__ == "__main__": + print("ImportVarName is being run directly") +else: + print("ImportVarName is being imported") diff --git a/tests/VariableName/VarName.py b/tests/VariableName/VarName.py new file mode 100644 index 0000000..3a26128 --- /dev/null +++ b/tests/VariableName/VarName.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- + +# Python __name__ module Test +# Author - HoneyMoose(huyuchengus@gmail.com) +# Link Article - https://www.ossez.com/t/python-name/13393 + +import ImportVarName + +print("Main VarName __name__ = %s" % __name__) + +if __name__ == "__main__": + print("VarName is being run directly") +else: + print("VarName is being imported")