foo.py 583 B

123456789101112131415161718192021222324252627
  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. class Person:
  15. def __init__(self, name):
  16. self.name = name
  17. def greet(self):
  18. print("Python >> Greetings, " + self.name)
  19. person = Person("Linus")