question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rand seed doesn't seem to work in 3.4+ only in 2.7.x

See original GitHub issue

I can’t get the random seed to work in 3.4+ only in 2.7 with fake-factory==0.5.9

`from faker import Factory, Generator, Faker

fake = Factory.create() fake.seed(4321)

for _ in range(10): print(fake.name()) ` Am I missing something?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
felixhummelcommented, Sep 7, 2016

Just for future reference (workaround until #363 is fixed):

$ python -V
Python 3.5.1

$ cat foo.py 
from faker import Faker
fake = Faker()
fake.random.seed(4321)
print(fake.name())

$ PYTHONHASHSEED=23 python foo.py 
Rhonda Peterson
$ PYTHONHASHSEED=23 python foo.py 
Rhonda Peterson

See also https://docs.python.org/3.3/using/cmdline.html#cmdoption-R for what changed since 3.3.

0reactions
fcurellacommented, Jul 2, 2018

Closing this for inactivity

Read more comments on GitHub >

github_iconTop Results From Across the Web

go - How to properly seed random number generator
Move the rand.Seed(time.Now().UTC().UnixNano()) line from the randInt function to the start of the main and everything will be faster.
Read more >
Python random.seed() function to initialize the pseudo-random ...
This article demonstrates how to use the random.seed() function to initialize the pseudo-random number generator in Python to get the ...
Read more >
Search Results - CVE
x -9.3.x, contain a predictable seed in pseudo-random number generator. A remote unauthenticated attacker could potentially exploit this vulnerability, leading ...
Read more >
Random (Java Platform SE 7 ) - Oracle Help Center
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence. void, setSeed(long seed). Sets the seed of this ...
Read more >
NetLogo 6.3.0 User Manual: NetLogo Dictionary
Note: only the observer can ask all turtles or all patches. ... each turtle turns a random base color ask turtles [ set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found