3
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())
我使用的资源文件和事情错了,当我使用它在open函数的参数,但是当我使用它的加载图片和图标一切都很好。OSERROR [错误22]无效的参数时,使用open()在Python
欢迎来到Stack Overflow!虽然这可能会在理论上回答这个问题,[这将是更可取的](// meta.stackoverflow.com/q/8259)在这里包括答案的基本部分,并提供参考链接。 – manetsus 2016-01-05 16:14:49
这个答案有一组问题: 1)'open('C:\ Python34 \ book.csv')'打开('C:\ Python34 \ book.csv')' - >没有区别在两条线之间。你是否打开('C:\\ Python34 \\ book.csv')'打开('C:\\ Python34 \\ book.csv')'? 2)示例中和第一行中的代码都是错误的,因为您不是逃避反斜杠(或者,在您的示例中,它们全部都是。) C:\ Python34 \\ book .csv''应该是''C:\\ Python34 \\ book.csv''或'r'C:\ Python34 \ book.csv'' – GPhilo 2017-05-31 09:41:08