• Skip to primary navigation
  • Skip to main content
  • About
  • Projects

Self-Directed Reality

Actions are greater than Thoughts

  • Archive of My Thoughts

user interface

Python Password Generator – Philadelphia Museum of Art

July 9, 2022 by Paris

Overview

In the Automated* VPN Account Management post, I stated that I created a VPN Password Generator using Python. This section is a quick look at that project and code in detail.

I am a new programmer and I am only on Day 8 of Dr. Angela Yu’s 100 Days of Code – The Complete Python Pro Bootcamp for 2022 course as of the time of this writing.

Suffice it to say that I learned a lot so far and learned even more putting this password generator together, especially with all of the tools and packages used that the course didn’t cover yet.

Solution

Step One – Goal and Resources

The goal of this VPN password generator is to randomly select 3 words from a set of 61000+ English words, counts the letters in each word, and randomly adds a compatible sign to the final string to generate a human-readable password. 

In addition, I created a GUI using PySimpleGUI and created a windows-based executable using PyInstaller so the program can be packaged and run locally on Windows devices in the Museum for easy password creation.

Here is a video of the Windows program in action, showing off the Generate, Copy, and Quit buttons working along with the Always on Top modifier enabled.

41 second video of the VPN Password Generator and Features

Additional Features include:

  • The ability to generate a new password just by clicking ‘generate’
  • The ability to copy the password to the clipboard using pyperclip clipboard
  • Always on top so the window can be closed at anytime
  • A color scheme that matches the design of the Philadelphia Museum of Art’s website. I even used the closest font I could find to match the layout.

List all of the resources I used for this project:

  • Python 3
  • Visual Studio Code
  • pyperclip
  • english_words
  • PySimpleGUI
  • PyInstaller
  • virtual environments (venv)
  • pip install packages and modules

Step Two – My Project Code

Here is my Python code for this project:
And yes I comment. I mean why wouldn’t I? Have you SEEN the rest of the projects on this site? 😂

# VPN Password Generator - Version 1.0
# This VPN password generator randomly selects 3 words from a set of 61000+ words, counts the letters in each word, and randomly
# adds a compatible sign to the final string.  
# Created by Paris Hunter www.parisdhunter.com

import random

# Imports Pyperclip to use to push the generated password to the clipboard
import pyperclip as pc

# Imports english-words 1.1.0 by Matt Wiens with 61000+ English words.
import english_words 

# Imports PySimpleGUI by MikeTheWatchGuy to create the interactive window
import PySimpleGUI as sg 

# This is the list of English words with lower case letters and no punctation stored in a set
# converted to a list for the random module to work

word_list = list(english_words.english_words_lower_alpha_set)

# The following signs are password friendly on most systems
signs = ['!', '#', '$', '&', '*']

# Randomly select word number one from the list, capitalize it and count the number of letters within the word
word_one = random.choice(word_list).capitalize()
length_one = len(word_one)

# Randomly select word number two from the list, capitalize it and count the number of letters within the word
word_two = random.choice(word_list).capitalize()
length_two = len(word_two)

# Randomly select word number three from the list, capitalize it and count the number of letters within the word
word_three = random.choice(word_list).capitalize()
length_three = len(word_three)

# Randomly select a sign from the sign list
chosen_sign = random.choice(signs)

# Combines all of the above into one string to use as the VPN password.
vpn = (f"{word_one}" + f"{length_one}" + f"{word_two}" + f"{length_two}"
 + f"{word_three}" + f"{length_three}" + f"{chosen_sign}")

# This is new PMA Theme
sg.LOOK_AND_FEEL_TABLE['PMA'] = {'BACKGROUND': '#FFFFFF',
                                        'TEXT': '#222222',
                                        'INPUT': '#339966',
                                        'TEXT_INPUT': '#000000',
                                        'SCROLL': '#99CC99',
                                        'BUTTON': ('#FFFFFF', '#C93F2E'),
                                        'PROGRESS': ('#D1826B', '#CC8019'),
                                        'BORDER': 1, 'SLIDER_DEPTH': 0,                                         
'PROGRESS_DEPTH': 0, }                                        

# This changes the theme of the window to match the PMA design styles.
sg.theme('PMA')

# Define the window's contents
layout = [[sg.Text("Here is your randomly generated human-readable password:", font= ('Avenir', 14, 'bold'))],
          [sg.Text(vpn, font= ('Avenir', 12), key='-OUTPUT-')],
          [sg.Text(size=(40,1),font= ('Avenir'), key='-OUTPUT-')],
          [sg.Text("Note: Press COPY to copy the password to your clipboard", font= ('Avenir', 10), text_color= '#404040')],
          [sg.Button('Generate', font= ('Avenir')), sg.Button('Copy', font= ('Avenir')) , sg.Button('Quit', font= ('Avenir'))]]

# Create the window
window = sg.Window('VPN Password Generator v1.0 by Paris Hunter', layout, use_custom_titlebar= 'true',titlebar_background_color= '#404040', keep_on_top= 'True', element_padding= 5,)

# Display and interact with the Window using an Event Loop
while True:
    event, values = window.read()
    # See if user wants to quit or window was manually closed
    if event == sg.WINDOW_CLOSED or event == 'Quit':
        break
    elif event == 'Generate':
        word_one = random.choice(word_list).capitalize()
        length_one = len(word_one)
        word_two = random.choice(word_list).capitalize()
        length_two = len(word_two)
        word_three = random.choice(word_list).capitalize()
        length_three = len(word_three)
        chosen_sign = random.choice(signs)
        vpn = (f"{word_one}" + f"{length_one}" + f"{word_two}" + f"{length_two}"
 + f"{word_three}" + f"{length_three}" + f"{chosen_sign}")
    # Updates the VPN password every time the 'generate' button is pressed
        window['-OUTPUT-'].update(vpn)
    
    # Copies the VPN password to the clipboard every time the 'copy' button is pressed
    elif event == 'Copy':
        pc.copy(vpn)

# Finish up by removing from the screen
window.close()

Future Features

If I was going to work on this in the future, there are a few things I would change:

Icon on Titlebar – Change the icon on the Title bar from the Python logo to a custom logo. I did the work to create a custom logo but I couldn’t get the image to display. I could have used an ICO file type but I wanted cross-platform compatibility (for Mac OS) so I ended up attempting Base64 to make the logo work. It didn’t work out for me and PySimpleGUI this time.

Icon on Windows Taskbar – There is NO icon on the Windows Taskbar to show that the program is even open/running so I that’s one reason why I made it ‘Always on Top’ so I (or another user) can’t lose it.

Icon on the Exe – The icon on the EXE was placed by Pyinstaller and it is simply a snake on a floppy disk. I am sure I could change those options when building the distributable, but it literally was my first time using it. And in addition, I would change the metadata about the project (creation date, version, etc ) as well.

Retail POS iPad Status Tracker – Philadelphia Museum of Art

July 9, 2022 by Paris

In early June 2022, all of the Retail iPads started experiencing intermittent disconnections from the employee Wi-Fi which sometimes happened in the MIDDLE of transactions, causing collateral problems.

In an effort to track down exactly what is happening, I suggested we keep a written list of disconnects and intermittent issues. With this information, so we can check the network logs and related data to determine if it is an hardware problem and/or a network problem.

Brief/Challenge

I decided to streamline the written process since the POS iPads are used by multiple staff members during peak weekend times (when IT is not onsite) and any resolution would require the combined efforts of the Retail and the IT department. The design cues for this project is an easy to use and centrally managed reporting system.

This form DOES NOT replace entering a normal help desk ticket, it is an additional component which can be helpful in the future for diagnostics where manual logs and/or a record of the issue makes resolutions quick and easier for all parties involved.

Solution

Step One – Assessment

In the first step of this project, I created the Retail Operations iPad Status Tracker form using Microsoft Forms to allow any staff member to report the timely status of an iPad from ANY other Retail iPad. As a note, the form link can be accessed from any internet connected device by PMA staff for reporting.

The form provides a list of Retail iPads, asks for the date, the rough time and a summary of the issue which goes into a spreadsheet which the IT department can read and review as these issues crop up. To assist with troubleshooting,

Question 1: Please select the affected iPad(s) from the list below.

I included all of the information for each iPad for the IT department to check the relevant systems for details without burdening the Retail staff.

  • Store Name: The iPad location and the designated register number.
  • Serial Number: This the department name + the serial number of the device. The full name (i.e. RETAIL-GG7YW73AJF8M) is the naming scheme for JAMF where the device can be managed through the MDM.
  • MAC Address & Bluetooth MAC Address: These MAC addresses are used to track down networking issues through the network logs of the IT Department.

Question 2: What date did the issue occur?

A date picker will appear on the screen where a user can select the appropriate date.

Question 3: Please enter the time that your issue occurred (in 15-minute increments)

This makes it easier to check network logs and the like if there is a specific time frame to focus on. In addition, I can assume that a user may be off 10-15 minutes in either direction depending on how busy they are.

Question 4: Please record your issue below and any additional notes.

This an open text form where a user can type in any relevant information to the Retail iPad POS so the IT department can have an idea of what to look for.


Step Two – Deploy and Track

Using our MDM system JAMF, I automatically pushed out the POS Status Track to all of the Retail iPads home screen. I used a sad emoji and the iPad as the icon because it will be easy to recognize and understand for the changing Retail staff. Additionally, any new iPad added to the Retail group in JAMF will automatically get this form link automatically installed.

36 second demo of the Retail POS Tracker app on iPad

The form data can be accessed through the back end of Microsoft Forms and downloaded and viewed in Excel. You can see screenshots of the Microsoft Forms backend below.


Outcome

This system is still being used to report the status of the Retail POS iPads in the Philadelphia Museum of Art and allows data to be easily captured for effective trend analysis. After a month of reporting so far, there seems to be something specifically wrong with the iPads in the American Store and/or the wireless network in that that area, which gives us a concrete angle.

Currently, the American Store was on a different network and now I am testing to see if the reported issues fall in line with the other iPads in the different stores (i.e. sub-10 reported issues over a month).

Further testing and troubleshooting will be required to narrow down the specific issue since all of the Retail iPads are the same model and on the same version of iPadOS.

As for the Status Tracker, it will be rolled out to other large deployments of iPad through JAMF so other departments can have a quick way to report sporadic and hard to document issues.

Future versions of this tracker could include a file/photo uploader in case screenshots/video footage is needed (i.e. a glitchy screen that only happens at a certain time, etc) which pairs well with the built in screen recording and screenshot software of the iPads.

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Copyright © 2025 · Twenty Seven Pro on Genesis Framework · WordPress · Log in