python 2.5 scripting in vim on windows: subprocess problem

Discussion in 'Python' started by Dmitry Teslenko, Oct 22, 2007.

  1. 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]
     
    Dmitry Teslenko, Oct 22, 2007
    #1
    1. Advertising

  2. 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
     
    =?Utf-8?Q?M=C3=A9ta-MCI_=28MVP=29?=, Oct 22, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tocer
    Replies:
    0
    Views:
    469
    tocer
    Aug 28, 2004
  2. Daniel Folkes

    New to Vim and Vim-Python

    Daniel Folkes, Oct 24, 2007, in forum: Python
    Replies:
    3
    Views:
    542
    projecktzero
    Oct 25, 2007
  3. Guoliang Cao

    vim 6.2 + vim-ruby don't work

    Guoliang Cao, Oct 16, 2003, in forum: Ruby
    Replies:
    1
    Views:
    161
    Brett H. Williams
    Oct 16, 2003
  4. Vincent Foley
    Replies:
    6
    Views:
    143
    Gavin Sinclair
    Apr 10, 2006
  5. lolveley
    Replies:
    3
    Views:
    208
Loading...

Share This Page