*2 Example of the dangers of temp files. DO NOT USE THIS CODE
cat >/tmp/python-script <<END
for i in range(10):
print(i)
END
python /tmp/python-script
If someone else creates /tmp/python-script first, this shell script won't even stop if it fails to overwrite the file. A malicious user on the system could make a harmful Python script which will run instead of the intended script.