Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Idea: piping arbitrary data to stdin #4

Open
jamert opened this issue Oct 30, 2014 · 0 comments
Open

Idea: piping arbitrary data to stdin #4

jamert opened this issue Oct 30, 2014 · 0 comments

Comments

@jamert
Copy link

jamert commented Oct 30, 2014

Sometimes you want to use some data in your program as input to some shell tool. Currently, if your data is not file-like object, you must jump through some hoops to make it work (StringIO object does not have fd, so it cannot be used). Personally, in such situation I would use tempfile module from standard library, but some transparent use of strings would be nice, I think.
Kinda like this:

pipes.run('cat /dev/stdin', stdin='something completely different')

or not so magical:

pipes.run('cat /dev/stdin', stdin=pipewrap('something completely different'))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant