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.

So, I'm developing a simple download manager powered by Wget, [EasyDownloader][1], which I'm using for learning Python, and I have a problem.

I want to save files at the Downloads folder, but it's not called 'Downloads' in computers without Ubuntu in English. So, I would like to know if there's a downloads path or something simmilar in Ubuntu?

share|improve this question
1  
Please do ask only one thing per question, otherwise it makes it more difficult to answer. Feel free to open a separate question for your other issue. –  David Planella May 16 '12 at 22:17
add comment

1 Answer

up vote 4 down vote accepted

Here's how you can get the downloads folder for any user in Python:

Gtk2:

import glib
downloads_dir = glib.get_user_special_dir(glib.USER_DIRECTORY_DOWNLOAD)

Gtk3:

from gi.repository import GLib
downloads_dir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DOWNLOAD)

Documentation:

share|improve this answer
    
Thanks, now I don't need my "Downloads" symbolic link! :P –  espectalll123 May 17 '12 at 19:11
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.