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.

46 lines
1.0 KiB

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