首页 > 解决方案 > 我想用 open() 函数打开一个文件。为什么我收到 TypeError: 'str' object is not callable?

问题描述

我无法打开文件。

open('file.txt')

我有:

Traceback (most recent call last):

  File "<ipython-input-60-f5022126236c>", line 1, in <module>
    open('file.txt')

TypeError: 'str' object is not callable

标签: python

解决方案


推荐阅读