I want to pass an optional if statement to Python functions to execute. For example, a function may copy some files from one folder to another, but a function may accept an optional condition.
So, for example, one method call may say "copy files from source to dest, if source.endswith(".exe")
The next call may simply be to copy files from the source to the destination without any conditions.
The next call might be copying files from source to destination, if today is monday
How do you pass these conditions to a function in Python?
source share