代码拉取完成,页面将自动刷新
'''
# Coding:utf-8
# Project: python-utility
# Author: rtf
# Time: 2022-08-19 15:22:38
# FileName: faker_news.py
# Software: PyCharm
'''
from faker import Faker
from faker.providers import internet
from pprint import pprint
# fake = Faker(['it_IT', 'en_US', 'ja_JP'])
# 数据生成器
def profile(num=10):
_list = list()
fake = Faker(['zh_CN'])
print(f'名字:{fake.name()}') # 名字
print(f'用户名:{fake.user_name()}') # 用户名
print(f'地址:{fake.address()}') # 地址
print(f'货币:{fake.currency()}') # 货币
print(f'时间:{fake.date_time()}') # 时间
print(f'职位:{fake.job()}') # 职位
print(f'手机号码:{fake.phone_number()}') # 手机号码
print(f'个人信息:{fake.profile()}') # 个人信息
print(f'颜色:{fake.color()}') # 颜色
print(f'城市:{fake.country()}') # 城市
print(f'银行卡信息:{fake.credit_card_full()}') # 银行卡信息
for _ in range(num):
_list.append(fake.profile())
return _list
def ip_address(num=10):
fake = Faker()
fake.add_provider(internet)
_list = list()
for _ in range(num):
_list.append(fake.ipv4_private())
return _list
print(ip_address())
print(profile(1))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。