# 此处不是真实的\x00 被 空格替换了
text = "boot_1__normal/                 "
print(text.strip()=="boot_1__normal/")
# 打印不可见字符
print(repr(text))
>>>
False
'boot_1__normal/\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
其中strip()只能去掉\r,\n,\t,无法去掉\x00。所以 text.strip()==“boot_1__normal/” 两者不相等
notebook中显示:
 
解决方案:
text = text.strip().lower()
print(text.strip(b'\x00'.decode())=='boot_1__normal/')
>>>
True
![[HGAME 2023 week1]Classic Childhood Game js前端查看](https://img-blog.csdnimg.cn/d593c4691d9f40669258ebc116324f32.png)


















