0
def get_text_filename():
    '''() -> str

       Return the name of the file containing the plaintext or cipher text.
    '''

    return input("Enter the file to read: ")

第一次输入文件名后,我希望能够调用输入的文件名是什么。我该怎么做呢?

4

1 回答 1

0

您可以将结果存储到变量中:

filename = get_text_filename()
print filename

然后您可以使用此filename变量获取用户输入的字符串。

于 2013-08-01T23:03:02.220 回答