For "safe" random numbers, Python does not actually generate them: it gets them from the operating system, which has a special driver that collects entropy from various sources in the real world, such as changes in time between keystrokes and disk tends.
source
to share