Paste #441411

Welcome On LodgeIt

Welcome to the LodgeIt pastebin. In order to use the notification feature a 31 day cookie with an unique ID was created for you. The lodgeit database does not store any information about you, it's just used for an advanced pastebin experience :-). Read more on the about lodgeit page. Have fun :-)

hide this notification

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#!/usr/bin/env python

import sys
import socket


if len(sys.argv) != 4:
    print "Usage: {} file host port"
    sys.exit(1)

output = socket.create_connection((sys.argv[2], sys.argv[3]))
writer = output.makefile('w')

with open(sys.argv[1]) as f:
    for line in f:
        writer.write(line)