0

Given this program named foo.py

#! /usr/bin/env python
foo = input('input foo: ')
print(foo)

How do I run this from foo_test.sh?

1 Answer 1

2

I figured it out so thought I'd post it. Simple, of course:

 % echo 'foodata' | ./foo.py

That does the job.

Sign up to request clarification or add additional context in comments.

1 Comment

Another way - make a plain text file input.txt with content "foodata". Then run ./foo.py < input.txt But for one simple line, your approach is a lot easier...

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.