为什么我会从编译器得到此错误?

时间:2019-03-22 11:57:12

标签: python

我在Visual Studio代码中用python写了一个代码

n=input(Give me the number)
v[n] = n-1
for i in range(n):
    s[i] = ""
state = n-1
while state == -1:
    i = 0
    if i == 0:
        state = state -1
        s[i] = "v"+i+1
    k = 0
    for j in range(n)    
        if v[j]<state:
            i = i+1
            s[i]= "v"+i+1
            k=1 
    state = state - 1    

并且我收到此错误,我以前曾经使用过编译器,并且调试过,所以我是第一次收到此错误

Traceback (most recent call last):
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\python-files\lib\python\ptvsd\wrapper.py", line 1422, in done
    fut.result()
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\lib\python\ptvsd\futures.py", line 40, in result
    reraise(self._exc_info)
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\lib\python\ptvsd\futures.py", line 163, in callback
    x = it.send(fut.result())
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\lib\python\ptvsd\wrapper.py", line 1533, in on_configurationDone
    self.send_process_event(self.start_reason)
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\lib\python\ptvsd\wrapper.py", line 1671, in send_process_event
    self.send_event('process', **evt)
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\lib\python\ptvsd\ipcjson.py", line 279, in send_event
    body=kwargs,
  File "c:\Users\isido\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\lib\python\ptvsd\ipcjson.py", line 103, in _send
    content = json.dumps(payload).encode('utf-8')
  File "C:\Python27\lib\json\__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "C:\Python27\lib\json\encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Python27\lib\json\encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb5 in position 52: invalid start byte

我不知道这是什么

0 个答案:

没有答案