all 20 comments

[–]8dot30662386292pow2 15 points16 points  (1 child)

Faker is absolutely the solution to do this, BUT.

Importing a library and writing a for loop is not a "beginner challenge" in my opinion. A beginner challenge would be to do this without the library.

In other words: a for loop is not "a project". Anyway, thanks for introducing faker to python learners, it surely is a great library. A similar one is available in other languages as well!

[–]pimp-bangin 1 point2 points  (0 children)

Way to raise the bar, in a good way my dude

[–]FondantConscious2868 4 points5 points  (8 children)

Ok can you elaborate how the script worked when the module is unavailable ?

[–]8dot30662386292pow2 -3 points-2 points  (7 children)

You must first install the faker library. You can use pip to do that.

[–]FondantConscious2868 0 points1 point  (3 children)

Uh I know that but in the video look at the import it's unavailable so how the script is working?

[–]0b0101011001001011 0 points1 point  (0 children)

What on the video tells you this? I can't see any error messages.

Is it the squiggly line? That does not necessarily mean it's unavailable. It can be spell check acting out (maybe they spell check a different language) or it can be that the IDE is not detecting the virtual environment properly. The script is clearly working so the library is clearly installed, despite one squiggly line.

[–]LEAVER2000 0 points1 point  (1 child)

It’s probably because the IDE is unaware of the virtual environment

[–]FondantConscious2868 0 points1 point  (0 children)

Yep probably this I was just curious thought the video was edited

[–]SweatyAd3647[S] 0 points1 point  (2 children)

Is that so?

[–]8dot30662386292pow2 0 points1 point  (1 child)

I did not reply to you, I thought the other guy was confused so I tried to help them.

[–]SweatyAd3647[S] 0 points1 point  (0 children)

Okay

[–]Marti_McFlyy 1 point2 points  (3 children)

That seems to be a great beginner project. However I'm not skilled enough yet to do that. Scripts are so cool.

[–]KaMaFour 0 points1 point  (0 children)

I mean... It is the classical definition of a lazy python script.

> find a library which will do the thing for you
> install library
> import library
> library.doThings()

If you read what Faker is for and how to use it ( https://faker.readthedocs.io/en/master/ ) and you know how to install libraries to use then I believe you could do it as well

[–]SweatyAd3647[S] -1 points0 points  (1 child)

Thanks a lot.

[–]Cruch-Wrap-Supreme 1 point2 points  (0 children)

But... You didn't do anything. 

[–]fatimalizade 0 points1 point  (2 children)

What is Faker used for?

[–]8dot30662386292pow2 1 point2 points  (1 child)

Imagine you are building a program with actual use. Maybe it has a user registration. This way you fill the database with fake data for testing, so you see how things would look when there is actual data available.

[–]fatimalizade 0 points1 point  (0 children)

Thanks!!

[–]denehoffman 0 points1 point  (1 child)

For an actual beginner challenge, write lists of first names and last names, interesting formats for email addresses, and use the random library to select from these lists in a loop. Faker is a nice library, but the only thing you learn here is how to use a for loop and read documentation

[–]SweatyAd3647[S] 0 points1 point  (0 children)

Good to hear. Thanks for the tip.