Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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://192.168.2.25/"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
2  
why not just import os; os.system("gvfs-mount smb://192.168.2.25/\"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: developer.gnome.org/gio/stable –  Timo Nov 25 '12 at 11:50
add comment

1 Answer 1

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 192.168.0.1/C 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
1  
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
add comment

Your Answer

 
discard

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.