Issues with arduino not receiving serial data

I am attempting to send data from two combo boxes to an arduino uno in order to move two stepper motors. The code on the arduino works in IDE with serial monitor, and for the most part the wxpython code is preforming as desired, the issue comes when data is sent to the arduino since it doesnt seem to recognize the serial data from wxpython as the input string. The arduino code is setup to look at outputs to see results.

wxpython code:
import wx
import serial
import time
ser = serial.Serial(‘COM3’, baudrate=9600, timeout=2)

class FrameUI(wx.Frame):

def __init__(self, parent, title):
    super(FrameUI, self).__init__(parent, title = title, size =(800, 800))

    # function for in-frame components
    self.InitUI()

def InitUI(self):
    # parent panel for radio box
    pnl = wx.Panel(self)
    # initialize static box
    self.sb = wx.StaticBox()
    lblList = ['Up', 'Down']
    self.rbox = wx.RadioBox(pnl, label = 'ISO Direction', pos = (55, 80), choices = lblList, majorDimension = 1, style = wx.RA_SPECIFY_ROWS)
    my_btn = wx.Button(pnl, label='Send Adjustments', pos = (220, 200))
    Adjustments = ['0.00', '0.01', '0.02', '0.03', '0.04', '0.05', '0.07', '0.08', '0.09', '0.10', '0.11', '0.12', '0.13', '0.14', '0.15', '0.16', '0.17', '0.18', '0.19', '0.20', '0.21', '0.22', '0.23', '0.24', '0.25', '0.26', '0.27', '0.28', '0.29', '0.30', '0.31', '0.32', '0.33', '0.34', '0.35', '0.36', '0.37', '0.38', '0.39', '0.40', '0.41', '0.42', '0.43', '0.44', '0.45', '0.46', '0.47', '0.48', '0.49', '0.50', '0.51', '0.52', '0.53', '0.54', '0.55', '0.56', '0.57', '0.58', '0.59', '0.60', '0.61', '0.62', '0.63', '0.64', '0.65', '0.66', '0.67', '0.68', '0.69', '0.70', '0.71', '0.72', '0.73', '0.74', '0.75'] 
    self.ISOcombo = wx.ComboBox(pnl, choices = Adjustments, pos = (55, 55), size =(55, 55))
    self.Zcombo = wx.ComboBox(pnl, choices = Adjustments, pos = (350, 55), size = (55, 55))
    self.rbox.Bind(wx.EVT_RADIOBOX, self.onRadioBox)
    self.ISOcombo.SetSelection(0.00)
    self.Zcombo.SetSelection(0.00)
    my_btn.Bind(wx.EVT_BUTTON, self.on_press)
    # create static box
    self.sb.Create(pnl, 2, label ="ISO Alignment", pos =(20, 20), size =(250, 160))
    


    # initialize static box
    self.sb = wx.StaticBox()
    # create static box
    self.sb.Create(pnl, 2, label ="Z Alignment", pos =(300, 20), size =(250, 160))
    lblListZ = ['Gantry', 'Table']
    self.rbox2 = wx.RadioBox(pnl, label = 'Z Direction', pos = (350, 80), choices = lblListZ, majorDimension = 1, style = wx.RA_SPECIFY_ROWS)
    self.rbox2.Bind(wx.EVT_RADIOBOX, self.onRadioBox2)
    arduinoState = ser.readline()
    print (arduinoState)
    # set frame in centre
    self.Centre()
    # set size of frame
    self.SetSize((580, 300))
    # show output frame
    self.Show(True)

        
def on_press(self, event):
    value = self.ISOcombo.GetStringSelection()
    value1 = self.Zcombo.GetStringSelection()
    selection = self.rbox.GetStringSelection()
    selection1 = self.rbox2.GetStringSelection()
    ISOadjust = float(value)
    Zadjust= float(value1)
    ISOpulses = round(float(ISOadjust/.003))
    Zpulses = round(float(Zadjust/.003))


    if selection == 'Down' and selection1 == 'Table':
        print(f'{ISOpulses*-1}')
        ser.write(ISOpulses)
        time.sleep(1)
        print(f'{Zpulses*-1}')
        ser.write(Zpulses)
        time.sleep(1)
        arduinoState = ser.readline()
        print (arduinoState)
        
    if selection == 'Down' and selection1 == 'Gantry':
        print(f'{ISOpulses*-1}')
        ser.write(str.encode(f'{ISOpulses*-1}'))
        time.sleep(2)
        print(f'{Zpulses}')
        ser.write(str.encode(f'{Zpulses}'))
        time.sleep(2)
        arduinoState = ser.readline()
        print (arduinoState)
    if selection == 'Up' and selection1 == 'Table':
        print(f'{ISOpulses}')
        ser.write(str.encode(f'{ISOpulses}'))
        time.sleep(2)
        print(f'{Zpulses*-1}')
        ser.write(str.encode(f'{Zpulses*-1}'))
        time.sleep(2)
        arduinoState = ser.readline()
        print (arduinoState)
    if selection == 'Up' and selection1 == 'Gantry':
        print(f'{ISOpulses}')
        ser.write(str.encode(f'{ISOpulses}'))
        time.sleep(2)
        print(f'{Zpulses}')
        ser.write(str.encode(f'{Zpulses}'))
        time.sleep(2)
        arduinoState = ser.readline()
        print (arduinoState)
        
def onRadioBox(self, event): 
   selection = self.rbox.GetStringSelection()
   print (f'{selection} selected')

def onRadioBox2(self, event): 
   selection = self.rbox2.GetStringSelection()
   print (f'{selection} selected')

wx App instance

ex = wx.App()

Example instance

FrameUI(None, ‘Beam Alignment Tool’)
ex.MainLoop()

arduino code
const byte numChars = 32;
char receivedChars[numChars]; // an array to store the received data
char receivedChars1[numChars];

boolean newData = false;

int dataNumber = 0; // new for this version
int dataNumber1 = 0;
int stepNumber = 0;
int pulseISO = 0;
int pulseZ = 0;

int currentStatePinA;
int previousStatePinA;
int currentStatePinB;
int previousStatePinB;

const int encoderPinA = 2;
const int encoderPinB = 3;
const int relayPinA = 4;
const int relayPinB = 5;
const int ISOmotordir = 6;
const int ISOmotordrv = 7;
const int Zmotordir = 8;
const int Zmotordrv = 9;

void setup() {
pinMode(encoderPinA, INPUT);
pinMode(encoderPinB, INPUT);
pinMode(relayPinA, OUTPUT);
pinMode(relayPinB, OUTPUT);
pinMode(ISOmotordir, OUTPUT);
pinMode(ISOmotordrv, OUTPUT);
pinMode(Zmotordir, OUTPUT);
pinMode(Zmotordrv, OUTPUT);
Serial.begin(9600);
Serial.println(“Waiting for ISO”);
}

void loop() {
recvWithEndMarker0();
showNewNumber0();
recvWithEndMarker1();
showNewNumber1();
ISOcountdown();
Zcountdown();
ISOmovement();
Zmovement();
}

void recvWithEndMarker0() {
static byte ndx = 0;
char endMarker = ‘\n’;
char rc;

if (Serial.available() > 0 && stepNumber == 0) {
rc = Serial.read();

if (rc != endMarker) {
  receivedChars[ndx] = rc;
  ndx++;
  if (ndx >= numChars) {
    ndx = numChars - 1;
  }
}
else {
  receivedChars[ndx] = '\n'; // terminate the string
  ndx = 0;
  newData = true;
}

}
}

void showNewNumber0() {
if (newData == true && stepNumber == 0) {
//receivedChars = Serial.readString().toInt(); // new for this version
dataNumber = atoi(receivedChars); // new for this version
pulseISO = abs(dataNumber);

Serial.print("ISO pulses:");
  Serial.println(pulseISO);
  Serial.print("Data as Number ... ");    // new for this version
  Serial.println(pulseISO);     // new for this version
  Serial.println("Waiting for Z");
newData = false;
stepNumber = 1;

}
}

void recvWithEndMarker1() {
static byte ndx = 0;
char endMarker = ‘\n’;
char rc;

if (Serial.available() > 0 && stepNumber == 1) {
rc = Serial.read();

if (rc != endMarker) {
  receivedChars1[ndx] = rc;
  ndx++;
  if (ndx >= numChars) {
    ndx = numChars - 1;
  }
}
else {
  receivedChars1[ndx] = '\n'; // terminate the string
  ndx = 0;
  newData = true;
}

}
}

void showNewNumber1() {
if (newData == true && stepNumber == 1) {
dataNumber1 = 0; // new for this version
dataNumber1 = atoi(receivedChars1); // new for this version
pulseZ = abs(dataNumber1);

Serial.print("Z pulses:");
  Serial.println(dataNumber1);
  Serial.print("Data as Number ... ");    // new for this version
  Serial.println(pulseZ);     // new for this version
  Serial.println("Executing movements");
newData = false;
stepNumber = 2;

}
}

void ISOcountdown()
{
currentStatePinA = digitalRead(encoderPinA);
currentStatePinB = digitalRead(encoderPinB);

if (newData == false && stepNumber == 2) {
digitalWrite(relayPinA, LOW);
digitalWrite(relayPinB, LOW);
if (currentStatePinA != previousStatePinA) {
pulseISO --;
Serial.println(pulseISO);
previousStatePinA = currentStatePinA;
}
if (currentStatePinB != previousStatePinB) {
pulseISO --;
Serial.println(pulseISO);
previousStatePinB = currentStatePinB;
}
if (pulseISO == 0) {
Serial.println(“Requested ISO position reached”);
stepNumber = 3;
}

}
}

void ISOmovement() {
if (newData == false && stepNumber == 2 && dataNumber > 0)
{
digitalWrite(ISOmotordir, LOW);
digitalWrite(ISOmotordrv, HIGH);
digitalWrite(Zmotordir, LOW);
digitalWrite(Zmotordrv, LOW);
}
if (newData == false && stepNumber == 2 && dataNumber < 0) {
digitalWrite(ISOmotordir, HIGH);
digitalWrite(ISOmotordrv, HIGH);
digitalWrite(Zmotordir, LOW);
digitalWrite(Zmotordrv, LOW);
}
if (newData == false && stepNumber == 0 && pulseISO == 0) {
digitalWrite(ISOmotordir, LOW);
digitalWrite(ISOmotordrv, LOW);
digitalWrite(Zmotordir, LOW);
digitalWrite(Zmotordrv, LOW);
}
}

void Zcountdown()
{
currentStatePinA = digitalRead(encoderPinA);
currentStatePinB = digitalRead(encoderPinB);

if (newData == false && stepNumber == 3) {
digitalWrite(relayPinA, HIGH);
digitalWrite(relayPinB, HIGH);

if (currentStatePinA != previousStatePinA) {
  pulseZ --;
  Serial.println(pulseZ);
  previousStatePinA = currentStatePinA;
}
if (currentStatePinB != previousStatePinB) {
  pulseZ --;
  Serial.println(pulseZ);
  previousStatePinB = currentStatePinB;
}
if (pulseZ == 0) {
  Serial.println("Requested positions reached");
  stepNumber = 0;
  digitalWrite(ISOmotordir, LOW);
  digitalWrite(ISOmotordrv, LOW);
  digitalWrite(Zmotordir, LOW);
  digitalWrite(Zmotordrv, LOW);
  digitalWrite(relayPinA, LOW);
  digitalWrite(relayPinB, LOW);
}

}
}

void Zmovement()
{
if (newData == false && stepNumber == 3 && dataNumber1 > 0)
{
digitalWrite(ISOmotordir, LOW);
digitalWrite(ISOmotordrv, LOW);
digitalWrite(Zmotordir, LOW);
digitalWrite(Zmotordrv, HIGH);
}
if (newData == false && stepNumber == 3 && dataNumber1 < 0) {
digitalWrite(ISOmotordir, LOW);
digitalWrite(ISOmotordrv, LOW);
digitalWrite(Zmotordir, HIGH);
digitalWrite(Zmotordrv, HIGH);
}
if (newData == false && stepNumber == 0 && pulseZ == 0) {
digitalWrite(ISOmotordir, LOW);
digitalWrite(ISOmotordrv, LOW);
digitalWrite(Zmotordir, LOW);
digitalWrite(Zmotordrv, LOW);
}
}