Hi

This is a little tighter:

#!/usr/bin/python
import sys

for line in  sys.stdin:
        replacement_line = "***" + line.strip()
        print  replacement_line


François


On Apr 28, 2013, at 5:22 PM, John Delacour <[email protected]> wrote:

> On 28/4/13 at 21:32, I wrote:
> 
>> Use a Text Filter, not a factory.  I don't know Python, but the process will 
>> be very similar to the Perl routine below...
> 
> Well, not really :-/  Here's a simple example of a Python text filter, the 
> result of a 5 minute crash course in this weird language:
> 
> #!/usr/bin/python
> import sys
> while 1:
>    existing_line = sys.stdin.readline()
>    if not existing_line:
>        break
>    replacement_line = "***" + existing_line.strip()
>    print replacement_line
> 
> All you need to do is add the regex stuff and the subroutines.
> 
> JD
> 
> 
> -- 
> -- 
> You received this message because you are subscribed to the "BBEdit Talk" 
> discussion group on Google Groups.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> <http://groups.google.com/group/bbedit?hl=en>
> If you have a feature request or would like to report a problem, please email 
> "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> 
> --- You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to