I have used
a=ser.write("TEST".encode()) in my code to send data using UART gpio in Rpi.
The code shows no error but when I print a,it gives me the length only.
Actually i am trying to interface Rpi and Nordic Nrf52832 using UART.
I want to send data to nrf from pi.
What return value do you expect instead?
It is normal that a write call returns the number of bytes written, a successful write returns the number of bytes it was supposed to write.
You can use a check similar to this
if (ser.write (data, length) != length) // Write not successful