I am having a problem where I am running a standard python socket server on my computer, which is connected to my wifi.
If I try to send data to the server with my iPhone using an app I made (note that the phone isn't connected to wifi, it is using LTE), the data does not go through. The same thing happens if the iPhone is connected to a different wifi.
I would like to know why the data doesn't go through, and what I can do to make the data go through (note 2: The iPhone transmits data perfectly if it is on the same Wi-Fi as the computer).
You should read https://en.wikipedia.org/wiki/TCP_hole_punching
If the two devices are not on the same wifi (local area network) then you will need to address the network address translation that needs to take place.
You could address this in the python socket code or in the wifi router such as enabling something sometimes called DMZ that essentially forwards all packets to a certain device on the wifi.