相关疑难解决方法(0)

OSError [Errno 22]在Python中使用open()时参数无效

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())
Run Code Online (Sandbox Code Playgroud)

我正在使用资源文件,当我在打开函数中使用它作为参数时出现问题,但是当我使用它来加载图片和图标时,一切都很好.

python

12
推荐指数
5
解决办法
12万
查看次数

标签 统计

python ×1