Python3 APRS Beacon

from socket import *
import time

# APRS-IS login info
serverHost = 'northwest.aprs2.net'
serverPort = 14580
aprsUser = 'CALLSIGN'
aprsPass = '0000'

# APRS packet
callsign = 'CALLSIGN'
#4 slashes required to 1 slash in Python3
btext = 'text goes here'

#TCP
sSock = socket(AF_INET, SOCK_STREAM)
sSock.connect((serverHost, serverPort))

#Login
login = f'user {aprsUser} pass {aprsPass} vers "NA7Q" \n'
sSock.send(bytes(login, 'utf-8'))

#Beacon
packet = f'{callsign}>APRS:{btext} \n'
sSock.send(bytes(packet, 'utf-8'))

#Disconnect
sSock.shutdown(0)
sSock.close()