I have a simple python script, test.py:
x = input("Enter string")
print("Entered str: ", x)
I want to run the script as another user; lets call him scratch:
sudo -u scratch python test.py
The program waits for the console input. When I enter "abc", I encounter the following error:
Enter stringTraceback (most recent call last):
File "test.py", line 1, in <module>
x = input("Enter string")
File "<string>", line 1, in <module>
NameError: name 'abc' is not defined
I am not sure about the reason behind this and the fix for it.