- Joined
- Jul 22, 2010
- Messages
- 1
- Reaction score
- 0
Hi,
I have a program that works fine on linux, which reads lines from VIM and modifies them before pasting back into the current file. I'm attempting to port this over to a windows XP environment. The program is having trouble with the "input_lines = sys.stdin.readlines()". Here is what the program looks like:
#! C:\python27\python.exe
import sys
## MAIN PROGRAM
def main():
input_lines = sys.stdin.readlines()
for i in input_lines:
print i
if __name__ == "__main__":
main()
#### END
Call it x.py. From VI I would use ":.,.+1!x.py" to run the script, but it just gives me the error "IOError: [Errno 9] Bad file descriptor". Does anyone know how to get around this? Or if it's even possible to do something like this using the windows version of VI.
Many thanks
Barry
I have a program that works fine on linux, which reads lines from VIM and modifies them before pasting back into the current file. I'm attempting to port this over to a windows XP environment. The program is having trouble with the "input_lines = sys.stdin.readlines()". Here is what the program looks like:
#! C:\python27\python.exe
import sys
## MAIN PROGRAM
def main():
input_lines = sys.stdin.readlines()
for i in input_lines:
print i
if __name__ == "__main__":
main()
#### END
Call it x.py. From VI I would use ":.,.+1!x.py" to run the script, but it just gives me the error "IOError: [Errno 9] Bad file descriptor". Does anyone know how to get around this? Or if it's even possible to do something like this using the windows version of VI.
Many thanks
Barry