tools.py 451 B

123456789101112131415161718
  1. # Tools
  2. import string, secrets
  3. # takes list of variables and checks if empty
  4. def check_fields(var_list):
  5. counter = 0
  6. for i in var_list:
  7. if not i:
  8. return False
  9. else:
  10. counter += 1
  11. if counter == len(var_list):
  12. return True
  13. def gen_alphanum():
  14. alphanumeric = string.ascii_letters + string.digits
  15. ralphanum = ''.join(secrets.choice(alphanumeric) for i in range(16))
  16. return ralphanum