[Python] file path not reading correctly in python

Discussão em 'Python' iniciado por Stack, Maio 26, 2025.

  1. Stack

    Stack Membro Participativo

    I have combed SO and have seen this question asked before but none of the answers are working in my code. I want to load the file board.kv from the subdirectory Board. Whether I use

    r'Board\board.kv'


    or

    R'Board\board.kv'


    or

    "Board\\board.kv"


    or even:

    'Board/board.kv'


    I get

    OSError: [Errno 22] Invalid argument: 'Board\x08oard.kv'


    While I don't think it is relevant, I am using PowerShell and tried going through examples using strings in the powershell python interpreter trying various strings like

    $myString = r'Board\board'

    $myString

    Board\\board

    but I can not get Board\board. Thanks for any help. I have never had a problem like this before.

    Continue reading...

Compartilhe esta Página