1 Star 0 Fork 0

陈峥芃/PythonProject

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
exerc3.py 563 Bytes
Copy Edit Raw Blame History
陈峥芃 authored 2021-05-07 22:23 +08:00 . 类对象
import json
txt = open("D:\\json.txt","r")
ls = json.load(txt)
print(ls)
class UserInfo:
name = ''
email= ''
qq = ''
password = ''
def __init__(self,n,e,q,p):
self.name = n
self.email = e
self.qq = q
self.password = p
def __str__(self):
message = print("姓名:{}\n邮箱:{}\nQQ:{}\n".format(self.name,self.email,self.qq))
return message
users = []
for i in ls:
user = UserInfo(i["name"],i["email"],i["qq"],i["password"])
users.append(user)
for user in users:
print(user)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/android_chen/python-project.git
git@gitee.com:android_chen/python-project.git
android_chen
python-project
PythonProject
master

Search