view src/testdir/test_channel_pipe.py @ 8299:d2a215e8d5b4 v7.4.1442

commit https://github.com/vim/vim/commit/e0fd2aa8f6544f9cf8286c707be3fb1c66c609e6 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 27 21:59:51 2016 +0100 patch 7.4.1442 Problem: MS-Windows: more compilation warnings for destructor. Solution: Add "virtual". (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Sat, 27 Feb 2016 22:00:05 +0100
parents 3ea56a74077f
children 764dba33605c
line wrap: on
line source

#!/usr/bin/python
#
# Server that will communicate over stdin/stderr
#
# This requires Python 2.6 or later.

from __future__ import print_function
import sys

if __name__ == "__main__":

    if len(sys.argv) > 1:
        print(sys.argv[1])

    while True:
        typed = sys.stdin.readline()
        if typed.startswith("quit"):
            print("Goodbye!")
            sys.stdout.flush()
            break
        if typed.startswith("echo"):
            print(typed[5:-1])
            sys.stdout.flush()
        if typed.startswith("double"):
            print(typed[7:-1] + "\nAND " + typed[7:-1])
            sys.stdout.flush()