user71954
user71954

Reputation: 1

Calling module , 'module' object is not callable

I have module with name Ioanv1:

...
person1={"temp_lags": [-21.96,-21.82,-21.89,-21.99]}
...
def ....

Now I want to replace person1 with new data in another script:

import json
import Ioanv1

person1={"temp_lags": [-21,-21,-21,-21]}
jsonToPython = Ioanv1(person1)
print(jsonToPython)

I get TypeError: 'module' object is not callable Could you please help me.

Upvotes: 0

Views: 79

Answers (1)

Erik Šťastný
Erik Šťastný

Reputation: 1486

Error message is simple and clear.

Ioanv1 is module

You are using Ioanv1(person1) which you can not. You probably want something like: Ioanv1.person1

Upvotes: 1

Related Questions