Python:faker生成测试数据
Python 生成 测试数据
2023-09-14 09:07:12 时间
文档:https://faker.readthedocs.io/en/master/index.html
依赖
pip3 install faker
代码实例
# -*- coding: utf-8 -*-
from faker import Faker
# 简体中文:zh_CN
faker = Faker(locale="zh_CN")
print(faker.name())
# 端玉
print(faker.phone_number())
# 15297715501
print(faker.country())
# 斯洛伐克
print(faker.province())
# 云南省
print(faker.city())
# 宜都县
print(faker.address())
# 甘肃省乌鲁木齐市高坪连街L座 407928
print(faker.company())
# 昂歌信息网络有限公司
print(faker.email())
# bhan@hotmail.com
print(faker.job())
# 物业管理
print(faker.user_agent())
# Mozilla/5.0 (compatible; MSIE 7.0; Windows 95; Trident/4.0)
相关文章
- Python实现随机生成头像
- python的random模块(生成验证码)
- Python中的作用域及global用法
- [Python模块学习]用qrcode模块生成二维码
- Python生成随机数组的方法小结
- Python - 使用objgraph生成对象引用关系图
- python 生成二维码,快速分享自己的博客地址
- Python Django根据数据库表生成模型类的命令
- Python头像动漫化,快来生成一个自己的动漫头像吧
- Py之qrcode:调用python的qrcode库两种方式生成二维码、带logo的二维码
- 微电网优化调度|农村农业区可再生能源微电网优化调度(Python代码实现)
- 干货|Python处理JSON格式的数据,太详细了吧!
- Python学习52:错误处理
- Python爬虫:使用newspaper解析新闻页面信息
- Python: itertools.compress()
- 使用python调用zxing库生成二维码图片
- python+pytest接口自动化 —— 参数关联
- python里实现DSL
- 使用sphinx快速为你python注释生成API文档
- 关于ORM,以及Python中SQLAlchemy的sessionmaker,scoped_session
- 【Leetcode刷题Python】473. 火柴拼正方形
- Python实现DBScan
- Python:随机生成测试数据的模块——faker的基本使用
- 【两阶段鲁棒优化】利用列-约束生成方法求解两阶段鲁棒优化问题(Python代码实现)
- python关键字保留字