在VS code中运行switch,提示SyntaxError: invalid syntax

之前是提示找不到文件

img


然后把periods复制的路径配置到utilities.py的412行,with open()代码里又提示SyntaxError: invalid syntax,

img

是哪里出问题了呀该怎么办😭

你字符串的引号呢

img

文件路径要加引号,

with open(C:\Usersl137251miniconda3lenvslswitch tutoriallswitch tutoriall3 zone tinylinputslperiods.csv) as infile:

改成

with open('C:\Usersl137251miniconda3lenvslswitch tutoriallswitch tutoriall3 zone tinylinputslperiods.csv') as infile:

路径字符串要加引号