Python can use Faker to make some virtual data
Preferred Installation Faker
Pip Install Faker
The old version is called Faker-factory, but it doesn't apply.
Use Faker. Factory.create () to create and initialize the Faker generator (generator)
Here's how to use it:
From Faker import Factory
fake = Factory.create ()
# OR
From Faker Import Faker
fake = Faker ()
Fake.name ()
# ' Lucy cechtelar '
Fake.address ()
# "426 Jordy Lodge
# Cartwrightshire, SC 88120-6700 "
Fake.text ()
After each call to Faker, the returned data is not the same
In order to be able to return data in the first run and second run, you can use the seed ()
From Faker Import Faker
fake = Faker ()
Fake.seed (4321)
Print (Fake.name ()) runs multiple times, the results are the same, and the test is easy to use
Official website: Https://github.com/joke2k/faker can be viewed in more detail using
Faker python constructs virtual data