Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a program that mounts a windows shared network drive using quickly. So I sat up my GUI and everything.. But I don't know any python commands that mount a network place.. Usually when I use the Linux script I use this command

gvfs-mount smb://"Extended (D)"

but of course this won't work with python.. So can anyone help me or give me the command to try to mount a specific network place?

share|improve this question
why not just import os; os.system("gvfs-mount smb://\"Extended (D)\"");? – Janus Troelsen Nov 24 '12 at 20:10
@Ysangkok thank you so much!! It worked.. Now I only need to finalize it and I will be done – xHellghostx Nov 24 '12 at 20:52
No no no no! Not again with the os.system "solutions"! We have GIO for a reason: – Timo Nov 25 '12 at 11:50
up vote 2 down vote accepted

You should have a look at GIO which will do the trick. Especially the GMountOperation and GVolume.

There's a working answer on SO which handles your issue.

share|improve this answer
Yeah I will try various commands and functions to make it mountable .. Although I am thinking of expanding it to accept a user Input for example and when the user hit the mount button.. It will mount the drive.. Any idea if I can do this? – xHellghostx Nov 25 '12 at 20:45
Just use a Gtk.Entry and its get_text() method to get the user input. – Timo Nov 25 '12 at 20:58
Awesome! Thanks!! – xHellghostx Nov 25 '12 at 23:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.