本文整理汇总了Python中Function.warning方法的典型用法代码示例。如果您正苦于以下问题:Python Function.warning方法的具体用法?Python Function.warning怎么用?Python Function.warning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Function
的用法示例。
在下文中一共展示了Function.warning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: writeHelp
# 需要导入模块: import Function [as 别名]
# 或者: from Function import warning [as 别名]
def writeHelp():
func.warning("\nPOSSIBILI ARGOMENTI:")
print("Super Nodo\t-sn")
print("Set Default Ip\t-ip group identifier")
print("Change Port\t-p port")
print("Change Port SN\t-pSN port")
print("Change time\t-t time")
print("Change ttl\t-ttl ttl")
print("")
sys.exit(-1)
示例2: update_network
# 需要导入模块: import Function [as 别名]
# 或者: from Function import warning [as 别名]
def update_network(host, SN, listPkt):
func.warning("\nP2P >> CREATION NETWORK")
while True:
nGroup = input("Inserire il numero del gruppo: ")
nElement = input("Inserire il numero dell'elemento del gruppo: ")
nPort = input("Inserire il numero della porta: ")
Fhost = [("172.030." + func.format_string(nGroup, const.LENGTH_SECTION_IPV4, "0") +
"." + func.format_string(nElement, const.LENGTH_SECTION_IPV4, "0") +
"|fc00:0000:0000:0000:0000:0000:" + func.format_string(nGroup, const.LENGTH_SECTION_IPV6, "0") +
":" + func.format_string(nElement, const.LENGTH_SECTION_IPV6, "0")), nPort]
if SN:
pk = pack.request_sn(host, const.PORT_SN)
func.add_pktid(pk[4:20], listPkt, const.PORT_SN)
else:
pk = pack.request_sn(host, const.PORT)
func.add_pktid(pk[4:20], listPkt, const.PORT)
s = func.create_socket_client(func.roll_the_dice(Fhost[0]), Fhost[1]);
if s is None:
func.error("Errore nella scelta del primo nodo vicino, scegline un altro.")
else:
s.sendall(pk)
s.close()
break
# Caricamento
print("Loading...")
for i in range(0, int(const.MAX_TIME / 1000)):
print("|", end = "")
print("|||" * i + " " * ((int(const.MAX_TIME / 1000) * 3) - (i * 3)) + "|")
time.sleep(1)
print("|" + "|||" * int(const.MAX_TIME / 1000) + "|")
if SN:
func.success("NETWORK CREATED:")
for h in sn_network:
func.gtext(h[0] + " - " + h[1])
if SN:
SN_host = [host, const.PORT_SN]
else:
SN_host = func.choose_SN(sn_network)
return SN_host
示例3: input
# 需要导入模块: import Function [as 别名]
# 或者: from Function import warning [as 别名]
func.error("Errore inserimento dati")
func.writeHelp()
elif sys.argv[i] == "-ttl":
try:
const.TTL = sys.argv[i + 1]
except:
func.error("Errore inserimento dati")
func.writeHelp()
elif sys.argv[i] == "-h":
func.writeHelp()
if SN:
func.warning("\nP2P >> INIZIALIZZAZIONE COME SUPER NODO")
else:
func.warning("\nP2P >> INIZIALIZZAZIONE COME PEER")
if host == "":
nGroup = input("Inserire il numero del gruppo: ")
nElement = input("Inserire il numero dell'elemento del gruppo: ")
host = ("172.030." + func.format_string(nGroup, const.LENGTH_SECTION_IPV4, "0") +
"." + func.format_string(nElement, const.LENGTH_SECTION_IPV4, "0") +
"|fc00:0000:0000:0000:0000:0000:" + func.format_string(nGroup, const.LENGTH_SECTION_IPV6, "0") +
":" + func.format_string(nElement, const.LENGTH_SECTION_IPV6, "0"))
func.gtext("IP: " + host)
####### DEMONI