I'm debugging some troublesome code. I like to use Vim and the anaconda prompt to run the code. Recently, I have noticed that pasting into the anaconda prompt is slow as it prints the code letter by letter. I've grown sick of waiting for it.
As an alternative, I decided to wrap the troublesome code in a function and load it into the console using an import statement. Then, I passed the data to the function like below:
from Calc_True_Negs import Classify()
Classify(ins)
I need several gigabytes of data loaded up in the console to run the code, so, it seemed convenient to load up the data first, then, only type an import statement into the console so that I could run the updated function.
The first time through, it worked great! The console printed the error statement, I went back to the code in the script and fixed the error. The code needed a second input variable, so, I updated the function in the script and went back to the same console and typed:
from Calc_True_Negs import Classify()
Classify(ins,outs)
I expected this to import the updated Classify() function and run it with the updated arguments. But instead I received this error:
TypeError: Classify() takes 1 positional argument but 2 were given
Seems like the Classify() function didn't update right? I made sure the script saved and tried again. Same error.
I thought I could delete the function, then, import it again, so, I entered:
del Classify
from Calc_True_Neg import Classify
Classify(ins,outs)
Yet again, I got the same error as before:
TypeError: Classify() takes 1 positional argument but 2 were given
I am wondering, why does this not update the function? And, is there a way to update the function, as I would like? Any ideas for other alternatives?