Assistance in converting VB.net to Python

Hello all, hopefully I’m posting in the right place. I’m working on a project that allows customers to scan a bar code with a scan gun, they click upload and it sends the code to a mysql database where it can be viewed and sorted. We were planning on using a Raspberry Pi 4 with Raspbian and use Mono to run the .exe file. That turned out to be a dead end. We still want to use the Raspberry Pi so we’ve opted to attempt in eliminating windows from the equation. The easiest for us would be moving to Python. I am a very new programmer, so constructive criticism is welcomed. Finally, my question is: Can anyone help me brainstorm/give me ideas and guidance on how this code should look in Python?

Thank you so much for your time and assistance!

(Again, I’m a new programmer, I realize there are better alternatives to most of my code, which is why I’m here. Thank you!)

Imports MySql.Data.MySqlClient
Public Class Form1

    Dim Uname As String
    ReadOnly connection As New MySqlConnection("datasource=192.168.1.134;port=3306;username='root';password='Khajiit19!';database = Barcodes")

    Private Sub Label1_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBoxPassword.TextChanged, TextBoxUsername.TextChanged

    End Sub

    Private Sub CheckBoxSP_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxSP.CheckedChanged

        If TextBoxPassword.UseSystemPasswordChar = True Then

            TextBoxPassword.UseSystemPasswordChar = False

        Else

            TextBoxPassword.UseSystemPasswordChar = True

        End If


    End Sub

    Private Sub ButtonCancel_Click(sender As Object, e As EventArgs) Handles ButtonCancel.Click

        Me.Close()

    End Sub

    Private Sub ButtonLogin_Click(sender As Object, e As EventArgs) Handles ButtonLogin.Click

        Dim command As New MySqlCommand("SELECT `username`, 'password' FROM `Accounts` WHERE `username` = @username AND `password` = @password;", connection)

        command.Parameters.Add("@username", MySqlDbType.VarChar).Value = TextBoxUsername.Text
        command.Parameters.Add("@password", MySqlDbType.VarChar).Value = TextBoxPassword.Text

        Dim adapter As New MySqlDataAdapter(command)
        Dim table As New DataTable()

        Try
            adapter.Fill(table)
        Catch ex As Exception
            MessageBox.Show("Could Not Connect To MySQL Server")
        End Try

        If table.Rows.Count = 0 Then
            MessageBox.Show("Invalid username or password")
        ElseIf MessageBox.Show("Login Succesful") Then
            Dim Barcode = New Barcode()
            Me.Hide()
            Barcode.ShowDialog()
            Me.Close()
        End If


    End Sub
End Class