Git Product home page Git Product logo

Comments (5)

masasin avatar masasin commented on May 25, 2024 1

I like appdirs. Thank you for this.

from mal.

ryukinix avatar ryukinix commented on May 25, 2024

Thanks for that suggestion! Is really a better this for Linux! By the way, exists someway to get the config folder for the user using a cross-plataform way? I will do this in soon!

from mal.

masasin avatar masasin commented on May 25, 2024

I've only really used Linux for the past 8 years, so I have no idea what everybody else does. Sorry!

from mal.

masasin avatar masasin commented on May 25, 2024

You can check the platform using sys.platform. Linux is linux or linux2, OSX is darwin, and Windows is win32 or cygwin

from mal.

ryukinix avatar ryukinix commented on May 25, 2024

Yes, I can do that! But I was wants a way to avoid this, as I don't use OSX I even more Windows, so is a little painful to mantain this. I was checking on sysconfig lib (stdlib), but she don't check the users path. But I found this lib called appdirs! Appears be nice, no?

from the main page:

the problem

What directory should your app use for storing user data? If running on Mac OS X, you should use:

~/Library/Application Support/<AppName>
If on Windows (at least English Win XP) that should be:

C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\<AppName>
or possibly:

C:\Documents and Settings\<User>\Application Data\<AppAuthor>\<AppName>
for roaming profiles but that is another story.

On Linux (and other Unices) the dir, according to the XDG spec, is:

~/.local/share/<AppName>

Oy maybe this usersettings lib. I don't know yet which is better. I'll try test in soon and modify this.

from mal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.