Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
357B

  1. """
  2. Utility functions for ABP
  3. """
  4. import json
  5. def xyz(x, y, z=0):
  6. return {"x": x, "y": y, "z": z}
  7. class ABPJsonEncoder(json.JSONEncoder):
  8. def default(self, thing):
  9. print thing
  10. if __name__ == '__main__':
  11. j = ABPJsonEncoder()
  12. print j.encode({1:2})
  13. j = ABPJsonEncoder()
  14. print j.encode({1:2})
  15. print j.encode({(1,2):2})