Here is an alternative using a variable local to the function:
def prtlines(line, isfirst = [ True ]):
if isfirst[0]:
# do something first time function is called
isfirst = [ False ]
# rest of function
Call the function using:
prtlines(line)
If you want to reset and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.