The '..' operator is the flip-flop operator in perl. (It is rarely
used.) It is exactly the same as the 'range' type operator. It returns
false until the first condition is met, then it returns true until the
last condition met, then it returns false.
You could create a flip-flop with a python clo
[EMAIL PROTECTED] wrote:
> i need help with converting a piece of perl code to python
> the problem is the '..' operator in perl. Is there any equivalent in
> python?
Here is a class that emulates the .. operator:
import sys
import re
start, files, end = map(re.escape, ["[start]", "[files]",
[EMAIL PROTECTED] wrote:
> the problem is the '..' operator in perl. Is there any equivalent in
> python?
I can't think of anything with a similar operation, to be honest. I'd
try using while loops which look out for the next section delimiter.
--
Ben Sizer.
--
http://mail.python.org/mailman/l
[EMAIL PROTECTED] enlightened us with:
> the problem is the '..' operator in perl. Is there any equivalent in
> python? any suggestions ?
I have a suggestion: stop assuming we know perl, and explain what this
'..' operator does.
Sybren
--
The problem with the world is stupidity. Not saying ther
hi
i need help with converting a piece of perl code to python
.
my $start = '\[start\]';
my $file = '\[files\]';
my $end = '\[end\]';
while() #open a file
{
if ( /$start/ .. /$file/ ) { # if line match [start] till
[files]
do something with $_
}
if