When I get used to as and learn python, there are still some obstacles. For example, if I execute while (true) in as, it must be an endless loop, the establishment of the python socket is exactly like this:
Server = socket. socket (socket. af_inet, socket. sock_stream)
Server. BIND (ADDR)
Server. Listen (999)
While true:
Clientsock, addrs = server. Accept ()
Print "Client IP:" + STR (addrs [0])
Print "client port:" + STR (addrs [1])
I have been wondering this aser for a long time. Why does Python keep executing the loop body? Today, I had a small experiment and suddenly realized it. It turns out that while true is not in a non-stop loop in the socket connection, but after the first execution, the socket. accept () will be in the listening mode. When will the listening be connected and when will the next loop body be executed. If there is no connection, the next loop will not be executed. Now I understand it.
If you still don't understand it, try this experiment.
While true:
Print 'running'
The latter will output 'running' continuously on the screen'
Also remind aser that 'isflash' + 123 in python is incorrect. This indicates that python does not automatically perform forced type conversion when adding characters and numbers. It must be manually processed as 'isflash' + STR (123)