ソースを参照

Added a main() function.

Jonathan Reem 12 年 前
コミット
6b920156b9
1 ファイル変更4 行追加2 行削除
  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()