FAQ
Hi

I'm trying to pipe data into a python program on Windows 2000, on the
command line.

Like this:
dir | myProgram.py


Here's what I tried:

== readFromStdin.py ==
#!/usr/bin.env python
import sys
print sys.sdtin.readlines()


When I run it on Linux and Windows, results differ
ls -l | ./readFromStdin.py - Works on Linux

dir | readFromStdin.py - Doesn't work on win2000
IOError: [Errno 9] Bad file descriptor

The ultimate goal is to write python scripts that I can use from
Komodo's (Python IDE) Run Command feature. I'm running Komodo on
Windows 2000.

I want to highlight some text in Komodo, and run my command, pasting
the output of my program back in to the file I was editing in Komodo.

Komodo makes this easy with built-in commands like sort. You just
select the "Pass Selection As Input" and "Insert Output" options,
highlight some text, type "sort" in the Run Command box, and voila,
Komodo pipes your highlighted text to sort, and pastes the sorted text
back into your editor window.

I want to write a Python program that can behave in the same way as
sort does, for use with Komodo on Windows 2000.

Thanks!

Christian Long

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJun 25, '03 at 8:28p
activeJun 26, '03 at 8:28a
posts4
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase