代码拉取完成,页面将自动刷新
#!/usr/bin/env python
# encoding: utf-8
"""
@author: kira
@contact: 262667641@qq.com
@file: main_personal_information.py
@time: 2023/7/21 17:44
@desc: 随机信息工具
"""
import random
from prettytable import PrettyTable
from faker import Faker
from common.random_tools.names import name
from common.random_tools.emails import email
from common.random_tools.phone_numbers import phone
from common.random_tools.identification import idcard
from common.random_tools.credit_cards import bankcard
from common.random_tools.credit_identifiers import credit_identifier
if __name__ == "__main__":
f = Faker(locale="zh_CN")
number = int(input("请输入大于2的数字以便生成随机用户信息:"))
table = PrettyTable(
("序号", "用户名", "性别", "年龄", "生日", "身份证", "银行卡或信用卡", "座机", "手机号", "邮箱", "地址",
"统一社会信用代码"))
for i in range(number):
sex_id = random.randint(0, 1)
user_name = name.get_girl() if sex_id == 0 else name.get_boy()
user_sex = "女" if sex_id == 0 else "男"
user_id_card = idcard.get_generate_id(sex=sex_id)
user_age = str(idcard.get_age(user_id_card))
user_birthday = idcard.get_birthday(user_id_card)
user_tele = phone.get_tele_number()
user_mobile = phone.get_mobile_number()
user_email = email.get_email(user_name)
user_address = f.address()
user_bank_card = bankcard.get_bank_card()
try:
unified_social_credit_code = credit_identifier.unified_social_credit_code()
except:
unified_social_credit_code = None
else:
table.add_row([i, user_name, user_sex, user_age, user_birthday, user_id_card, user_bank_card,
user_tele,
user_mobile, user_email, user_address, unified_social_credit_code])
print(table)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。