470,855 Members | 1,208 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

Trying to use cscope via pipes

Hi all,

I'm currently trying to put together a small script to talk to cscope
(http://cscope.sf.net/) via pipes. The obvious way to do this is via
popen2 (or popen4).

I've tried both the one in the os module and the one in the popen2
module, and I get the same effect with both - I don't get any response
on the stdout pipe until I've closed the stdin pipe, even if I call

What I'm trying to do should be possible, I think - cscope says that
it supports a line-oriented interface for this kind of thing, and the
cbrowser tool (written in tcl) uses cscope as a backend via pipes. So
the conclusion is that I'm missing something, but I can't quite work
out what... any ideas?


from os import popen2

handles = popen2("cscope -d -l")
writer = handles[0]
reader = handles[1]

#without closing it'll just hang... strange.
lines = reader.readlines()
print lines

I'm using the following Python, since there aren't Python 2.3 RPMs
until Fedora C2 (and this is a work machine which I shouldn't update
too much):

Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2


Jul 18 '05 #1
1 1698
I wrote:
the conclusion is that I'm missing something, but I can't quite work
out what... any ideas?

Never mind - it was made clear by Donn Cave in
<do************************@gnus01.u.washington.ed u>.

Next time I shall attempt to engage brain before asking.


Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Christian Hammers | last post: by
5 posts views Thread by glenn.owens | last post: by
2 posts views Thread by Rudolf Bargholz | last post: by
9 posts views Thread by Hans J?rg Brinksmeyer | last post: by
reply views Thread by Roland Puntaier | last post: by
4 posts views Thread by =?Utf-8?B?UmljaGFyZEBub3NwYW0ubm9zcGFt?= | last post: by
3 posts views Thread by ZhukovL | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.