我想在python中开发一个代码,它将在localhost中打开一个端口,并将日志发送到该端口.日志只是python文件的命令输出.
喜欢 :
hello.py
i = 0
while True:
print "hello printed %s times." % i
i+=1
Run Code Online (Sandbox Code Playgroud)
这将不断打印声明.我想要这个续.输出发送到打开的端口.
任何人都可以告诉我如何做同样的事情?
提前致谢