代码拉取完成,页面将自动刷新
from faker import Faker
fak = Faker(locale="zh_CN")
if __name__ == '__main__':
print("faker !")
# -2m 2个月前
# today 今天
# -1y 一年前
# now 此刻
target_time_now = fak.date_time_between(start_date="-2y", end_date="-1y")
target_date = fak.date_between(start_date="-2y", end_date="-1y")
print("target_time_now ", target_time_now)
print("target_date ", target_date)
print("name ", fak.name())
print("digit ", fak.random_digit())
print("random int ", fak.random_int())
print("future date ", fak.future_date())
print("future datetime ", fak.future_datetime())
print("email ", fak.email())
print("address ", fak.address())
print("phone ", fak.phone_number())
print("company ", fak.company())
print("idcard ", fak.ssn(min_age=18, max_age=70))
print("bankcard ", fak.credit_card_number())
print("job ", fak.job())
print("text ", fak.text())
print("profile ", fak.profile())
print("datetime ", fak.date_time())
up_sql = """
UPDATE `tb_user` SET `user_id` = '{}', `username` = '{}', `email` = '{}', `cellphone` = '{}', `create_time` = '{}',
`update_time` = '{}' WHERE `id` = {};
"""
for pid in range(100):
print(up_sql.format(fak.random_int(min=10000, max=50000),
fak.name(),
fak.email(domain="163.com"),
fak.phone_number(),
fak.date_time_between(start_date="-2y", end_date="-1y"),
fak.future_datetime(), pid))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。