I've never used from os import *
So this duplicate suggestion is not valid. Please look at the code in the description.
I'm not sure why I am running into this error. I thought it would be a simple with open() method but it isn't working. I have a .txt file that I'm trying to open and I'm getting this error.
I'm not sure why it is asking for a integer vs a string to open a .txt file
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)