[Python] OSError [Errno 22] invalid argument when use open() in Python

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

  1. Stack

    Stack Membro Participativo

    def choose_option(self):
    if self.option_picker.currentRow() == 0:
    description = open(":/description_files/program_description.txt","r")
    self.information_shower.setText(description.read())
    elif self.option_picker.currentRow() == 1:
    requirements = open(":/description_files/requirements_for_client_data.txt", "r")
    self.information_shower.setText(requirements.read())
    elif self.option_picker.currentRow() == 2:
    menus = open(":/description_files/menus.txt", "r")
    self.information_shower.setText(menus.read())


    I am using resource files and something is going wrong when i am using it as argument in open function, but when i am using it for loading of pictures and icons everything is fine.

    Continue reading...

Compartilhe esta Página