【发布时间】:2011-05-19 13:36:03
【问题描述】:
我想在 python 中开发一个代码,它将在 localhost 中打开一个端口并将日志发送到该端口。日志只是 python 文件的命令输出。
喜欢:
hello.py
i = 0
while True:
print "hello printed %s times." % i
i+=1
这将连续打印语句。 我想要这个续集。输出要发送到打开的端口。
谁能告诉我怎么做?
提前致谢
【问题讨论】:
-
什么协议? HTTP? FTP? .. 港口的另一边是什么?我的意思是服务器。
-
@pyfunc - 没有协议,我在我的本地主机上使用。
-
@pastjean :是的,我会喜欢的。谢谢
标签: python command-line tcp send