By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,715 Members | 748 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,715 IT Pros & Developers. It's quick & easy.

connect to server question

P: n/a
jay
Is there a way to connect to servers on OS X using Python?

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?

Thanks!

Jay
Dec 4 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Dec 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.