这个简单的代码:
s = "it's a nice day..."
s = shlex.split(s)
会导致ValueError: No closing quotation
错误:
Traceback (most recent call last):
File "<pyshell#27>", line 1, in <module>
s = shlex.split(s)
File "C:\Python\Python35-32\lib\shlex.py", line 273, in split
return list(lex)
File "C:\Python\Python35-32\lib\shlex.py", line 263, in __next__
token = self.get_token()
File "C:\Python\Python35-32\lib\shlex.py", line 90, in get_token
raw = self.read_token()
File "C:\Python\Python35-32\lib\shlex.py", line 166, in read_token
raise ValueError("No closing quotation")
ValueError: No closing quotation
我认为'
是错误的。我该如何处理?我从文件中读取了这一行,所以我不能只\
在每个引用或其他内容之前输入。