[Tutor] Plz help me from this

Carlos Daniel Ruvalcaba Valenzuela clsdaniel at gmail.com
Wed Sep 5 08:26:06 CEST 2007


Yes is very possible to do this with python.

Checkout the os.system and os.popen functions to run external commands
(chmod, chown).

Reading the list of users and groups should be easy, just open the
file and read line by line and parse, you can do it as simple as
splitting the line on colon character (:) and parsing the resulting
list.

It seems you will also need some form of UI, simple print and
raw_input may do the trick.

On 9/4/07, chinni <srikanth007m at gmail.com> wrote:
> Hi All,
>
>
> I Want to write a python script to change the permissions(chmod) and
> owner(chown) and group(chgrp) of a file on unix,
> script as to read from the /etc/passwd for displaying available users on the
> machine and from /etc/groups it as to display the available groups and user
> has to give the mode and owner name and group name from the list.
>
> Can i implement this in python or in shell scripting
> Can any one please suggest me from doing this...:)
>
> --
> Best Regards,
> M.Srikanth Kumar,
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>


More information about the Tutor mailing list