Vim/emacs event with actual files!

"Iain Duncan" <[email protected]>
Newsgroups gmane.comp.audio.csound.tekno
Message-ID <013401c3c234$33205230$e8dce8d8@xornot>
Oh yeah, the attach button! ;P

Iain
zero.py (text/plain, 606 B)
#zero.py
#very simple python function to reset all numbers in selection to 0 

# we'll start by replacing only one line

import sys
import re

# get the selection into python
# input[x] now hold line x as a string
input = sys.stdin.readlines()

# dummy replacement value for now
# change this to an arg next
new_str	=	'0'

# make the reg ex for all number text objects
my_reg = re.compile( '[0-9]+' )

# need to count how many lines are in the block.
for i in range( len(input) ):

	# turn all the '1's into '0's
	new_line = my_reg.sub( new_str, input[i] )

	# print out the new string
	print new_line,
testfile (application/octet-stream, 238 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.