[Fixed]-Can't call an existing function from python shell

1👍

✅

You need to import the actual name you want to use. Just importing testApp won’t do anything; you would need to do from testApp.hello import Hello.

Note also that since for some reason you have a class, sayHello is an instance method and therefore needs to accept the self parameter; also, you would need to instantiate the class before calling the method. However, Python is not Java, and there is absolutely no need for the Hello class to exist.

Leave a comment