(请注意:我是 Python 的初学者)当我尝试输入我的 bssid 时,它给了我一个断言错误,它引用了另一个名为 common.py 的代码文件的一部分,我认为它是我的代码编辑器 (thonny) 附带的。我将如何解决这个问题?
import os
import time
opsys = input("Are you using MacOS or Windows? ")
if (opsys.lower() == "windows"):
print("\n Alrighty, let me just open u your command prompt for you.")
time.sleep(0.5)
os.system("start /B start cmd.exe @cmd /k netsh wlan show interfaces")
time.sleep(0.25)
bssid = input("\nNow paste in the set of numbers labelled BSSID: ")
print("Thanks")
这是断言错误从 common.py 引用的语句:
def parse_message(msg_string: str) -> Record:
# DataFrames may have nan
# pylint: disable=unused-variable
nan = float("nan") # @UnusedVariable
assert msg_string[0] == MESSAGE_MARKER
return eval(msg_string[1:].encode("ASCII").decode("UTF-7"))
这是整个回溯错误:
Traceback (most recent call last):
File "C:\Users\tjmon\Documents\Honors Comp Sci\Other Programs\Lab3.py", line 60, in <module>
bssid = input("\nNow paste in the set of numbers labelled BSSID: ")
File "C:\Users\tjmon\AppData\Local\Programs\Thonny\lib\site-packages\thonny\common.py", line 220, in parse_message
assert msg_string[0] == MESSAGE_MARKER
AssertionError