0

This is my shell script, and I want to run the method foo(param):

#!/bin/sh    
python /Users/username/Desktop/forTrump/test.py

How would I run a function inside test.py using the shell script above?

1

1 Answer 1

1
python -c 'import test; print test.foo(param)'
Sign up to request clarification or add additional context in comments.

3 Comments

If you are satisfied with the answer can you mark it as answered
Please start writing halfway-decent answers with explanations, not just code dumps, and stop hassling OPs to accept.
I would like to run this in a shell script with absolute path "/Users/username/Desktop/forTrump/test.py" I am not printing anything just running the method, which will run to a file, should I still include "print"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.