Skip to content

LuigiDeFacci/Python-Random-Password-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Random Password Generator

This program generates a random password of a fixed length and displays it on a label. The password is generated by combining uppercase letters, lowercase letters, digits, and symbols.

Requirements

This program requires the following modules:

  • random: to generate random values.
  • string: to get predefined sets of characters.
  • tkinter: to create the GUI.
  • pyperclip: to copy and paste text to and from the clipboard.

Constants

The program uses the following constants:

  • PASSWORD_LENGTH: the length of the password to be generated.
  • UPPERCASE_CHARS: a string containing all uppercase letters.
  • LOWERCASE_CHARS: a string containing all lowercase letters.
  • DIGITS: a string containing all digits from 0 to 9.
  • SYMBOLS: a string containing all punctuation symbols.
  • ALL_CHARS: a list containing all possible characters for the password.

Functionality

The program defines a function generate_password() that generates a random password and displays it on the label. The function works as follows:

  1. Create an empty password string.
  2. Choose a random uppercase letter and add it to the password.
  3. Choose a random lowercase letter and add it to the password.
  4. Choose a random digit and add it to the password.
  5. Choose a random symbol and add it to the password.
  6. Fill the remaining characters with random choices from all possible characters.
  7. Shuffle the password to make it more unpredictable.
  8. Display the password on the label and copy it to the clipboard.

User Interface

The program creates a root window with a title "Random Password Generator" and a size of 500x100 pixels. It then creates a button "Generate Password" that calls the generate_password() function when clicked. A label is also created that initially shows an empty string, but is updated with the generated password when the button is clicked. The generated password is also copied to the clipboard.

How to Run

To run the program, execute the Python file random_password_generator.py. This will open the GUI window. Click the "Generate Password" button to generate a new password. The password will be displayed on the label and copied to the clipboard.

About

Python Random Password Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages