python 2.5 scripting in vim on windows: subprocess problem

D

Dmitry Teslenko

Hello!
I'm using subprocess.Popen in python script in vim.
It called this way:
def some_func():
p = subprocess.Popen( command , stdout = subprocess.PIPE, stderr =
subprocess.STDOUT)
while True:
s = p.stdout.readline()
if not s:
break
self.__output( '... %s' % s )
return p.wait()

It filters command's output and re-ouputs it in stdout.
Being called from console, it works fine.
Being called from vim with :python some_func() it says:
file "...subprocess.py", line 586 in __init__
....
file "...subprocess.py", line 699, in _get_handles
....
file "...subprocess.py", line 744 in _make_inheritable
DUPLICATE_SAME_ACCESS
WindowsError: [Error 6]
 
G

Guest

Hi!

VIM can, also, to be OLE-COM-server.

Try with:
from win32com.client.dynamic import Dispatch
vim = Dispatch('Vim.Application')

(+google)

@-salutations

Michel Claveau
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top