Need a linux and mac user to help me test something

I want to know the path to your games config files

import os

def test():
    print (os.getenv('LOCALAPPDATA'))

This piece of code will on windows get me into:

This directory is meant for any game to place their config files, etc.
I want to have the right path for linux and mac as well.

So could you test the above script by altering it to the correct folder and see if it prints out that path and then reply back to me with what works?


prints nothing on linux

Linux do not have a ‘LOCALAPPDATA’ anyway

In Linux classically you would use ~/.config/your-game to store settings and stuff. A new way was introduced by XDG and use folder in ~/.local/share. Choose your poison!

i get an error from doing that, i had to use full path

import os

def test():
    usr = os.getlogin()
    path = '/home/{usr}/.config'


“So could you test the above script by altering it to the correct folder”

so something like:

print (os.getenv('.config'))

for mac i believe

print (os.getenv('HOME'))

would work

but i need to be sure, and home doesn’t sound as a folder to keep settings etc

print (os.getenv('HOME'))


Yes it should, but is home the directory to store the configs?
or do i still need to add ‘{usr}/.config’ to it?

path = os.getenv(‘HOME’)+"/.config"

should do the trick

yes i know but i need to get to that path directly

 print (os.getenv('LOCALAPPDATA'))

so what should be used and is working instead of localappdata here?

that is what i try to figure out

are you able to test that?

i don’t mind adding more to the path as long as i can get the base path with os.getenv(‘HOME’)

this should work

import os
import platform

if platform.system() == "Linux":
    path = os.getenv('HOME') + "/.config"
    path = os.getenv('LOCALAPPDATA')

That is indeed what i trying to build, atm i threw this together

import sys

def get_operating_system(cont):
    own = cont.owner
    systems = {
                'Linux'                     :['linux','linux2'],
                'Windows'                   :['win32', 'cygwin'],
                'Mac OS X'                  :['darwin'],
                'Operating system 2 (OS/2)' :['os2', 'os2emx'],
                'Risc OS'                   :['riscos'],
                'Athe OS'                   :['atheos']
    user_system = sys.platform
    for a,b in systems.items():
        if user_system in b:
            own['Text'] = a 

so if that works, then i only need a path to the mac version