I need to create decorator for a function so that if a particular function is called twice in a row with the same parameters, it will not run, and return None instead.
The function being decorated can have any number of parameters, but no keyword arguments.
For example:
@dont_run_twice def myPrint(*args): print(*args) myPrint("Hello") myPrint("Hello") #won't do anything (only return None) myPrint("Hello") #still does nothing. myPrint("Goodbye") #will work myPrint("Hello") #will work