[Tutor] New to Python and Linux

Andreas Kostyrka andreas at kostyrka.org
Wed Sep 26 09:27:47 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well, chmod 0700 is usually not want you want:

a) 0700 gives only read/write/execute rights to the user. Technically
for historical reason permissions can be written as an octal number,
with the first digit being optional, encoding stuff like setuid/setgid
permissions. The last 3 digits code permissions for user, group and
other, one octal digit each. 4 is read, 2 is write and 1 is execute. We
aware that on directories execute permission allows you to access/search
the directory, while read allows you to "read" (==list) the directory.
So a typical permission for scripts would be 755 (read/exec for all,
write on top of that for the owner), or 775 (on distributions that give
each user their own primary group).

b) Specifying permissions as octal numbers is not really necessary
nowadays (and has not been necessary for over a decade, at least on
Linux): chmod a+x => add eXecute rights to All. chmod u=rwx,og=rx => set 755

Andreas

Jason M Barnes wrote:
> Hi,
> 
> Another way to execute your program is to open up your file with
> gedit, and on the very first line type (sans quotes) "#!/usr/bin/env
> python" by itself and save it.  Then, go to the terminal like Michael
> said, and cd into the directory with your file.  Type "chmod 0700
> your-program.py" at the prompt.  This allows you to execute your
> program without invoking python first.  That way when you are cd'ed
> into the directory that contains your program, you can type
> "./your-program.py" at the prompt, and it should run.
> 
> If you're going to switch to linux, then you'll need to learn how to
> make the most of your CLI.  I'd suggest googling for tutorials on the
> linux command line.
> 
> Jason
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG+gnyHJdudm4KnO0RAgyXAJ9YGKU2OU9p2pnG4YyS15ZLwzj8vACfRAQD
H7jawyovWfkd9fEm36MfBBs=
=FquY
-----END PGP SIGNATURE-----


More information about the Tutor mailing list