rolisz's site

Redirecting Python output from the command line

Today I needed to write a quick script that does some operations on colors. Because I'm trying to learn Vim and I'm trying to master the command line (not the standard Windows one, but Console2 + PyCmd), of course I wrote it with command-line usage in mind. The script starts taking shape, so let's use it. Well, it prints out the desired output. What next? Let's redirect its output to the clipboard. A quick Google search revealed the clip utility, which copies to the clipboard its stdin.

colors.py middle #000 #FFF | clip

Some­thing's wrong - pasting won't work. The output shows up ok in the console, but it won't redirect continue.