My python file: /root/src/foo.py
#/root/src/foo.py
def add(a,b):
'''add(a,b) --> a+b'''
return a+b
How do I call foo.add(a,b) from a shell script? I got this suggestion from somewhere:
python -c "import foo; print(foo.x(1, 2))"
But it won't work if the shell script and foo.py are in a separate locations.