I am trying to run a python program on the terminal directly without using the interpreter's name but I am getting error:
$ cat > scr.py
#!/usr/bin/env python3
print ("Hello World") ^Z [2]+ Stopped cat > scr.py
But when I try to execute the program:
osboxes@osboxes:~$ ./scr.py
bash: ./scr.py: /usr/bin/env: bad interpreter: Text file busy
osboxes@osboxes:~$ chmod +x scr.py
osboxes@osboxes:~$ ./scr.py
bash: ./scr.py: /usr/bin/env: bad interpreter: Text file busy
osboxes@osboxes:
But when I use the name "python3" explicitly, the program executes
osboxes@osboxes:~$ cat scr.py
#!/usr/bin/env python3
print ("Hello World")
osboxes@osboxes:~$ python3 scr.py
Hello World
osboxes@osboxes:~$
Somebody please guide me how to solve this problem.
Zulfi.
0 Answers