Skip to content

Instantly share code, notes, and snippets.

@hagun
Created September 10, 2013 08:57
Show Gist options
  • Select an option

  • Save hagun/6506776 to your computer and use it in GitHub Desktop.

Select an option

Save hagun/6506776 to your computer and use it in GitHub Desktop.
stdin을 읽어서 tcp socket으로 전송. python버전
#!/usr/bin/python
import sys
import socket
HOST = '192.168.161.117'
PORT = 4333
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
for line in sys.stdin:
s.send(line)
s.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment