I am trying to run a script(myscript.py) using
python manage.py shell < scripts/myscript.py
but nothing happens.
Here is my code
myscript.py
def foo(x):
print(x+1)
if __name__ == '__main__':
x = 10
foo(x)
any help please
Note:
I am new to django
I am using python 3.6 and django 1.10.6
__name__and you will see why. - Klaus D.__name__is not'__main__'Output:Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> >>> >>> >>> >>> >>> >>> ... ... ... ... ... ... ... ... ... ... >>> ... ... ... ... ... ... ... ... ... >>> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... >>> >>> ... ... ... ... ... ... ... ... ... ... now exiting InteractiveConsole...- Pahara Siagian