我从未使用过fromos import *
,因此此重复建议无效。请看说明书中的代码。在
我不知道我为什么会遇到这个错误。我原以为用open()方法会很简单,但它不起作用。我有一个.txt文件,我试图打开,我得到了这个错误。在
我不知道为什么它要求一个整数而不是一个字符串来打开一个.txt文件
import os
import spacy
import en_core_web_sm
import plac
from collections import Counter
from __future__ import unicode_literals
file = 'spacy_sample.txt'
with open(file, 'r' )as f:
'''Do something'''
TypeError Traceback (most recent call last)
<ipython-input-198-b6441a57e84e> in <module>()
----> 1 with open(file, 'r' )as f:
2 print(f)
TypeError: an integer is required (got type str)
目前没有回答
相关问题 更多 >
编程相关推荐