<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_rules(self, op_file):
 """ save the rules to file after web updates or program changes """

        with open(op_file, 'w') as f:
            for m in self.maps:
                f.write(m.format_for_file_output())