Bad Magic Number

I created a file updating system. It updated .pycs because I don’t want it to update .EXEs every time and because I don’t want it to be open sourced. But whenever I run the .pyc in the terminal I get

RuntimeError: Bad magic number in .pyc file
Press any key to continue…

Forgot to mention this in the post: Anyone that can help?

The error is that it’s not sending all the data. For me it perfectly sends other files, but I’m guessing this one is too big (it’s 40 KBs). I am currently sending/recving 1024 bytes… how do I fix this?