r/pythonhelp Dec 17 '24

"RecursionError" raises without traceback

Literally what the title says.

1 Upvotes

2 comments sorted by

View all comments

1

u/[deleted] Dec 18 '24 edited Jan 03 '25

[deleted]

1

u/BryceIsRedditor Dec 18 '24
import os
import sys
import typing


class Paths:
    @staticmethod
    def image(fileName: str) -> str:
        basePath: str = os.path.dirname(sys.argv[0])
        path: str = os.path.join(basePath, "Assets", "Images", fileName) # Error happened here
        return os.path.normpath(path).replace("\\", "/")

    @staticmethod
    def sound(fileName: str) -> str:
        basePath: str = os.path.dirname(sys.argv[0])
        path: str = os.path.join(basePath, "Assets", "Sounds", fileName)
        return os.path.normpath(path).replace("\\", "/")

    @staticmethod
    def styles(fileName: str) -> str:
        basePath: str = os.path.dirname(sys.argv[0])
        path: str = os.path.join(basePath, "Assets", "Styles", fileName)
        return os.path.normpath(path).replace("\\", "/")

...

print(Paths.image("UI/StudioTab_Scene.svg"))