I am using one shell script to call python function -
python -c 'import create_table; create_table.createTable()'
This script is in "scripts" directory and create_table.py file is in another directory - "cdk" Folder structure will look like this -
infra -> cdk -> create_table.py
-> scripts -> run-script.sh
cdk and scripts directories are at same level inside infra directory.
When I am trying to run my script it is giving below error -
ModuleNotFoundError: No module named 'create_table'
I tried placing create_table.py file in scripts directory, but still it's giving same error. I am referring this question - Calling a Python function from a shell script Can anyone please help me out? Am I missing something here?
Update - create_table.py code
import boto3
def createTable():
print("createTable function")
There is no class in this python file.