connect to server question
"Martin v. Löwis"
martin at v.loewis.de
Tue Dec 4 05:16:46 EST 2007
> Here's the code I presently use in a Bash Shell script:
>
> /bin/mkdir -p /Volumes/A_Share
> /sbin/mount_afp "afp://username:password@ServerBox/A_Share"
> "/Volumes/A_Share"
>
> Can something similar be done with Python?
You can always use os.system to do what the shell does, ie.
os.system("/bin/mkdir -p /Volumes/A_Share")
os.system('/sbin/mount_afp "afp://username:password@ServerBox/A_Share"
"/Volumes/A_Share" ')
In the case of mkdir, you could also use os.mkdir instead, or
os.makedir if you are uncertain whether intermediate directories
exist.
Regards,
Martin
More information about the Python-list
mailing list