I have a file test.py
with this code:
def getTrue():
return True
def getSome():
return getTrue()
somevar = getSome()
print(somevar)
When I run the script using
python manage.py shell < test.py
I get the error
NameError: name 'getTrue' is not defined
After adding
import unicodedata
To the top of the file and then try using some function from unicodedata I get this error:
NameError: name 'unicodedata' is not defined
I don't see how the answer to the question that my question is marked as a possible duplicate of is answering this part.
When I run the file normally with
python3 /path/to/file/test.py
There is no problem and True
is printed like expected.
Any idea what is going on?