Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
此代码适合您。
with open('yourfile.txt','r') as file: data = file.read().splitlines() data = [set(a[1:-1].split(',')) for a in data] print(data)
您也可以在此处使用eval,但是使用eRAT可能是 危险 。
eval
eRAT
危险
with open('yourfile.txt','r') as file: data = file.read().splitlines() data = [eval(a) for a in data] print(data)
This code work for you.
You can use eval also here, But using eval might be dangerous.
dangerous
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
此代码适合您。
您也可以在此处使用
eval
,但是使用eRAT
可能是危险
。This code work for you.
You can use
eval
also here, But usingeval
might bedangerous
.