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.

35 lines
651 B

  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. import sys
  4. import pydoc
  5. sys.path.append('.')
  6. from example import kw_func, kw_func2, kw_func3, kw_func4
  7. print(pydoc.render_doc(kw_func, "Help on %s"))
  8. print(pydoc.render_doc(kw_func2, "Help on %s"))
  9. print(pydoc.render_doc(kw_func3, "Help on %s"))
  10. print(pydoc.render_doc(kw_func4, "Help on %s"))
  11. kw_func(5, 10)
  12. kw_func(5, y=10)
  13. kw_func(y=10, x=5)
  14. kw_func2()
  15. kw_func2(5)
  16. kw_func2(x=5)
  17. kw_func2(y=10)
  18. kw_func2(5, 10)
  19. kw_func2(x=5, y=10)
  20. try:
  21. kw_func2(x=5, y=10, z=12)
  22. except Exception as e:
  23. print("Caught expected exception: " + str(e))
  24. kw_func4()
  25. kw_func4(myList = [1, 2, 3])