SoFunction
Updated on 2024-11-19

python string to list list appears \ufeff solution

As shown below:

# The contents of the file lisi
lock = open("lock_info.txt", "r+",encoding="utf-8")
lock_line = ()
lock_list = lock_line.split(",")
print(lock_list)

y = lock_line.encode('utf-8').decode('utf-8-sig')
print(y)

# The printout is as follows
['\ufefflisi']
lisi

Above this python string to list list appeared \ufeff solution is all I share with you, I hope to give you a reference, and I hope you support me more.