Pygame trouble loading files


#1

No idea what the problem is but here is what I’ve got:
I get the error: OSError: unable to read font file '28DaysLater.ttf'
The problem I have, is when I run the exact thing in IDLE, it works fine. This is on a mac. Furthermore, I can run this on atom and IDLE on my windows computer too just fine. So I am confident I am running into a problem with atom but I don’t know what to do to fix it. I am using atom-python-run to run it, but also using this exact thing on my windows PC, so I think that it works fine.

One small difference that could possibly cause an issue, is in atom on my mac, I did have to change the command for atom-python-run to python3 as opposed to python. I don’t know if this could cause a difference but either way I seem to have a problem with file path.


#2

Figured it out. Had to specify the path for some reason which is a bit annoying but I guess would be fine in the end.
Added:
path = os.path.abspath(file)
path = path[0:-10]
The -10 was simply to cut off the ‘Name.py’ at the end of the file path.


#3

Based on your description, you probably have different project folders open on the different windows. Your current directory, for packages like atom-python-run, is generally always the same as the first project folder you have open. You should make sure to either specify your paths relative to that, use absolute paths, or use a package that gives you a more fine level of control, such as process-palette.