im still seeing people use the random module for stuff that actually matters lol. its basically just math formulas so if someone guesses the seed youre cooked. it says you should be using secrets instead to pull from /dev/urandom or whatever on linux.
>If someone knows (or can guess) the seed, or sees enough outputs, the sequence becomes predictable.makes sense but i wonder how much entropy you actually get in a real production environment. if youre just doing a quick script it doesnt matter but for anything serious u gotta use:
import secretsimport stringall_chars = string.ascii_letters + string.digits + string.punctuationpassword = ''.join(secrets.choice(all_chars) for _ in range(12))
pretty much standard if you dont want to get
hacked by a script kiddiefound this here:
https://www.freecodecamp.org/news/how-to-build-a-secure-password-generator-with-python/