本文整理汇总了Python中Client.client方法的典型用法代码示例。如果您正苦于以下问题:Python Client.client方法的具体用法?Python Client.client怎么用?Python Client.client使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.client方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Client [as 别名]
# 或者: from Client import client [as 别名]
def __init__(self, ip_addr, port):
self.TCPsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.TCPsock.bind((ip_addr, port))
self.node_list = []
self.clients = []
#self.connectedList =[]
self.TCPsock.listen(1)
conn, addr = self.TCPsock.accept()
print "server accepted connection from ..\n"
data_string = conn.recv(1024)
data = pickle.loads(data_string)
self.node_list = data
print "printing list: \n"
for x in self.node_list:
print "ip:"
print x.ip_addr
print "\t"
print "Port:"
print x.port
print "\n"
i = 0
for x in self.node_list:
if (x.port == port) :
continue
#c = Client.client(x.ip_addr, x.port, self.connectedList)
c = Client.client(x.ip_addr, x.port)
self.clients.append(c)
self.clients[i].start()
i = i + 1
示例2:
# 需要导入模块: import Client [as 别名]
# 或者: from Client import client [as 别名]
import tkinter as tk
import LoginClient
import RoomMenu
import Client
cl = Client.client()
cl.connect()
loginroot = tk.Tk()
loginCl = LoginClient.LoginClient(cl,master=loginroot)
#oom = RoomMenu.RoomMenu(cl,master=roomroot)
loginCl.mainloop()
#room.mainloop()