Hello I would like to ask if is possible to update my app with a socket server like in other apps when there is an update so its downloading and updating the code without downloading the app again
To answer you question directly, "yes, it is possible".  Python is a general purpose language and can do that kind of thing readily enough.  the "how" will depend your app.
UPDATE my script in python with python socket