本文整理汇总了Python中Agent.Agent.new_server方法的典型用法代码示例。如果您正苦于以下问题:Python Agent.new_server方法的具体用法?Python Agent.new_server怎么用?Python Agent.new_server使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agent.Agent
的用法示例。
在下文中一共展示了Agent.new_server方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eval
# 需要导入模块: from Agent import Agent [as 别名]
# 或者: from Agent.Agent import new_server [as 别名]
port = eval(sys.argv[2])
print "Create agent for module serverdefs"
# Here we create an agent for a module!
agent = Agent('serverdefs', '138.221.22.200', port)
print "Ok, agent created and configured"
print "\nThe following methods are available:"
dict = agent.__dict__
for item in dict.keys():
if hasattr(dict[item], '__class__') and dict[item].__class__ == Agent.Method:
print ' '*3, item
print "\nCreate an instance of a server object"
server = agent.new_server()
print "\nThe following methods are available:"
dict = server.__dict__
for item in dict.keys():
if hasattr(dict[item], '__class__') and dict[item].__class__ == Agent.Method:
print ' '*3, item
def print_attrs(server):
print "Values of attributes:"
print " _a_ =", server._a_
print " _b_ =", server._b_
print
print_attrs(server)