Home > Mobile >  'int' object not callable when opening a file in python
'int' object not callable when opening a file in python

Time:05-08

I am getting what seems to be an odd error when trying to open a file in python. I am simply trying to open a csv:

with open(filename, 'a') as history:

filename is simply a string pointing the file:

filename = file_path "\\dashboards\\" csv_file

it is identified as a string in python, but whenever I get to the open statement, it returns:

TypeError}'int' object not callable

That seems odd as it is just a csv file, with a header. Has anyone run across this before? ``

CodePudding user response:

It looks like you may have defined open as a variable somewhere else with an int value. This is causing the error message.

  • Related