1 #coding=utf-8 2 #!/user/bin/env python 3 # connect.py 17:35 2007-9-28 zhangsk 4 5 import socket 6 7 print "Creating socket", #加逗号,相当于c的print,不加逗号相当于c的println 8 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 9 print "done." 10 11 print "Connecting to remote host", 12 s.connect(("www.google.com", 80)) 13 print "done."
看到支持插入python的代码,特发个尝试一下。
|