I have a small shell script in a string inside my python file.
Now I'd like to run this script via subprocess.call() and I wonder what's the best way.
My first thought was to write the script to a StringIO and specify that via stdin=... but unfortunately you cannot specify a StringIO since it doesn't have a fileno() method.
Of course I could use stdin=subprocess.PIPE and then write to it using subprocess.communicate() but I wonder if there's a simpler method.