练习第一题,第二题
Topic source如果想多次输入,可以改成下面的代码:
def input_command():
command = input("please input command:>>>\n")
DIR_L(command)
def DIR_L(command):
if command == "exit":
return
if command == "dir -l":
curDir = os.path.abspath(".")
dirlist = os.listdir(curDir)
for x in dirlist:
print(x)
input_command()
else:
print("No such command")
input_command()
input_command()
- 1
起名不好起2012
第一题:简单的处理,判断输入是否是'dir -l'
第二题: