Browse Source

Added a main() function.

Jonathan Reem 12 năm trước cách đây
mục cha
commit
6b920156b9
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      3-tier.py

+ 4 - 2
3-tier.py

@@ -44,11 +44,13 @@ class Ui(object):
             print('That product "{0}" does not exist in the records'.format(product))
 
 
-if __name__ == '__main__':
-
+def main():
     ui = Ui()
     ui.get_product_list()
     ui.get_product_information('cheese')
     ui.get_product_information('eggs')
     ui.get_product_information('milk')
     ui.get_product_information('arepas')
+
+if __name__ == '__main__':
+    main()