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.

41 lines
865 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, call_kw_func
  7. from example import args_function, args_kwargs_function
  8. print(pydoc.render_doc(kw_func, "Help on %s"))
  9. print(pydoc.render_doc(kw_func2, "Help on %s"))
  10. print(pydoc.render_doc(kw_func3, "Help on %s"))
  11. print(pydoc.render_doc(kw_func4, "Help on %s"))
  12. kw_func(5, 10)
  13. kw_func(5, y=10)
  14. kw_func(y=10, x=5)
  15. kw_func2()
  16. kw_func2(5)
  17. kw_func2(x=5)
  18. kw_func2(y=10)
  19. kw_func2(5, 10)
  20. kw_func2(x=5, y=10)
  21. try:
  22. kw_func2(x=5, y=10, z=12)
  23. except Exception as e:
  24. print("Caught expected exception: " + str(e))
  25. kw_func4()
  26. kw_func4(myList=[1, 2, 3])
  27. call_kw_func(kw_func2)
  28. args_function('arg1_value', 'arg2_value', 3)
  29. args_kwargs_function('arg1_value', 'arg2_value', arg3='arg3_value', arg4=4)