One difference is that "./ script.py" only works if script.py is executable (as in file permissions), but "python script.py" works independently. However, I strongly suspect that there are more differences, and I want to know what they are.
I have a Django site, and "python manage.py syncdb" works fine, but "./manage.py syncdb" for some reason creates a broken database, which remains a mystery to me. Perhaps this is due to the fact that syncdb requests the username and password of the superuser from the command line, and perhaps the use of "./manage.py syncdb" changes the way it interacts with the command line, thereby changing the password. May be? I'm just puzzled by this mistake. "python manage.py syncdb" completely fixes it, so this is just curiosity.
Thanks.
Edit: Right, I forgot about the need for the shebang line #! / Usr / bin / python. But I just checked: "python manage.py syncdb" and "./manage.py syncdb" use the same Python interpreter (2.7.2, the only one installed on Linux Mint 12). But previous works and the latter do not.
Can the environment variables seen by Python code be different? My code requires $ LD_LOADER_PATH and $ PYTHON_PATH, which will be set specifically for each shell.
source share