+ 1
Need to know this :::----
i am learning python now as a starter but all i want to know that can i create scripts with this language and if i can how. ..... cause im a server admin ,just got this position. and now I'm managing Ubuntu virtual servers so i need the knowledge of UNIX/linux scripting any suggestions would be great
4 Respostas
0
yes you can create scripts. just save your code in a .py file
0
OK thanks for help Max but one more thing do I need to write
#! /bash/shell/py.
in the beginning
0
not that i’m aware of. maybe read this: https://stackoverflow.com/questions/2429511/why-do-people-write-the-usr-bin-env-JUMP_LINK__&&__python__&&__JUMP_LINK-shebang-on-the-first-line-of-a-pyt
0
python (or Perl) are great for Linux scripting (easier to manage than bash!)
The shebang line is not mandatory, and platform dependant. maybe useful if you want to run the script directly as executable on linux (rather than:
$python yourscript.py )
and helps identifying the file as python script.