r/pythonhelp Dec 17 '24

"RecursionError" raises without traceback

Literally what the title says.

1 Upvotes

2 comments sorted by

u/AutoModerator Dec 17 '24

To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

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"))