Py学习  »  Python

如何将输入作为参数传递给python中的另一个函数?它不

Alex • 5 年前 • 1569 次点击  
def executeCommand(myDoc): 
    print(myDoc)
    return 

def insert():
    print("insert command:")
    return

def delete():
    print("delete command:")
    return

def main():
    print("Functional Text Editor ")
    executeCommand(input("Type in file name: "))

if __name__ == '__main__':
    main()

然后,主运行会提示“键入文件名:”但之后不执行任何操作。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/40979
 
1569 次点击  
文章 [ 1 ]  |  最新文章 5 年前