I try use the super admin and use #!/usr/bin/python
at the top however it also doesn't work
Actually, I want to open the .py
document but terminal shows that print: command not found
.
I try use the super admin and use #!/usr/bin/python
at the top however it also doesn't work
Actually, I want to open the .py
document but terminal shows that print: command not found
.
Just type python
in your terminal to invoke the interactive shell. You gave the command in the bash terminal beginning with #
, which inactivated the whole line.
If you want to run a python script, then put your code in a file like this:
script.py
#!/usr/bin/python
print "2"
Now you can run the code typing python script.py
.
The first line of the code is the shebang line, which specifies which interpreter to use, so you can run your script typing ./script.py
.