一旦你在一个函数中,你将如何在原来的函数中从一个函数导航到另一个函数(我编写了伪代码,因为我不知道如何实现这一点)
def main():
do...
if something == 1
access function(Success)
elif something == 2
access function(Failed)
elif something == 3
end script
else
print "choose a proper option idiot"
def menuSuc():
print 1) How many total requests (Code _____)
print 2) How many requests from _____ (IPs starting with 142.204)
print 3) How many requests for isomaster-1.3.13.tar.bz2
print q) Return to Main Menu
def menuFai():
print 1) How many total failed requests (Codes _____)
print 2) How many invalid requests for wp-login.php
print 3) List the filenames for failed requests for files in /apng/assembler/data
print q) Return to Main Menu
def success(argv):
do.....
print menuSuc
print information
def failed(argv):
do.....
print menuFai
print information
只需在函数内部调用要使用的函数。我会避免在Python代码中调用函数。别忘了在Python3中print是一个函数,在引号周围加“()”
主()
相关问题 更多 >
编程相关推荐