foo.py 645 B

123456789101112131415161718192021222324252627282930313233
  1. import api
  2. def hello(name):
  3. print("Python >> Hello, " + name)
  4. return "You are " + name
  5. def goodbye():
  6. print("Python >> Calling Go functions")
  7. api.say_goodbye()
  8. def bad():
  9. raise Exception("this is a Python exception")
  10. def say_name():
  11. print("Python >> The name is " + api.concat("Tal", "Liron"))
  12. def say_name_fast():
  13. print("Python >> The name is " + api.concat_fast("Tal", "Liron"))
  14. size = 0
  15. def grow(count):
  16. global size
  17. size += count
  18. class Person:
  19. def __init__(self, name):
  20. self.name = name
  21. def greet(self):
  22. print("Python >> Greetings, " + self.name)
  23. person = Person("Linus")