def returnSomeObject(File):
. . .
SomeObject = loader.load(File)
return SomeObject
if __name__ == "__main__":
return returnSomeObject(sys.argv[1])
When trying to return an object from the "__main__
" python function, I get:
SyntaxError: 'return' outside function
turns out the file I was calling it from was the problem location, I needed to Replace
import returnSomeObject as returnSomeObject
with:
from returnSomeObject import returnSomeObject
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments