[Tutor] python newbie..system call help
Mike Pindzola
pindzola at charter.net
Wed Jul 13 02:36:49 CEST 2005
Yes, I have did 'import os'. For starters I want to read the result of
'pwd' and print it out in the program for the user to see what path is
being read. Also, I need to have a function to handle root access if the
user does not have such privledges since I will be mounting and
unmounting hardware. So a call to 'su' would be in order as well as
sending the user provided password back to it.
Aside from that, just so copying of files, making dirs, and changing
file permissions.
jfouhy at paradise.net.nz wrote:
>Quoting Mike Pindzola <pindzola at charter.net>:
>
>
>
>>Should I be even trying to make a system call? Is there a better way to
>>talk to the shell? Either way, please enlighten me. Thanks.
>>
>>
>
>There may be a better way to achieve what you want to do, without using the
>shell at all. For example, the os and os.path modules include a range of
>functions for manipulating files and directories (listing, walking, moving,
>renaming, et cetera). Perhaps, if you say what you are trying to achieve, we
>can give some pointers.
>
>
>
More information about the Tutor
mailing list