Generally speaking, when using a raw socket you must use some sort of framing. For example, you can prefix a message with its length in bytes, represented as a fixed-size integer (say, 4 bytes). Then the other side can always receive a full message: first read until you get exactly 4 bytes, parse that as a length, then read exactly this many bytes and that's the message.
okay, i thought abt it but thought there might be a simpler way since its python lol i literally just a few weeks ago started coding with python seemed like it hah