def get_profiles() -> list:
    """
    Gets a list of names from saved wifi networks in the current platform
    """
    profiles = []

    platform = get_platform()

    try:
        if platform == constants.MAC:
            # Command found here : https://coderwall.com/p/ghl-cg/list-known-wlans
            profiles = run_command(f"defaults read ~/Library/Logs/com.apple.wifi.syncable-networks.plist | grep \" SSID\" | sed 's/^.*= \(.*\);$/\\1/' | sed 's/^\"\\(.*\)\"$/\\1/'").split('\n')
        elif platform == constants.LINUX:
            if os.getuid() != 0:
                ssid = run_command(f"sudo ls /etc/NetworkManager/system-connections/ | grep .nmconnection").split('\n')
            else:
                ssid = run_command(f"ls /etc/NetworkManager/system-connections/ | grep .nmconnection").split('\n')
            
            for entry in ssid:
                profiles.append(entry.split('.nmconnection')[0])
        elif platform == constants.WINDOWS:
            # Reference: https://www.geeksforgeeks.org/getting-saved-wifi-passwords-using-python/
            # getting meta data
            meta_data = run_command('netsh wlan show profiles | findstr ":"')

            if meta_data != "":
                # splitting data line by line
                data = meta_data.split('\n')

                if len(data) > 0:
                    # skip the first element in data since it does not contain a valid profile returned by netsh command
                    profiles = [d.split(':')[1].strip(' .\r') for d in data[1:]]
    except Exception as ex:
        print(f'Error: {ex}')

    return profiles

    Gets a list of names from saved wifi networks in the current platform
    
wifi_password/utils.py