diff --git a/tutorial/py/PythonClient.py b/tutorial/py/PythonClient.py
index c4559ff..8000483 100755
--- a/tutorial/py/PythonClient.py
+++ b/tutorial/py/PythonClient.py
@@ -19,65 +19,70 @@
 # under the License.
 #
 
-import sys, glob
+import sys
+import glob
 sys.path.append('gen-py')
 sys.path.insert(0, glob.glob('../../lib/py/build/lib*')[0])
 
 from tutorial import Calculator
-from tutorial.ttypes import *
+from tutorial.ttypes import InvalidOperation, Operation, Work
 
 from thrift import Thrift
 from thrift.transport import TSocket
 from thrift.transport import TTransport
 from thrift.protocol import TBinaryProtocol
 
-try:
 
-  # Make socket
-  transport = TSocket.TSocket('localhost', 9090)
+def main():
+    # Make socket
+    transport = TSocket.TSocket('localhost', 9090)
 
-  # Buffering is critical. Raw sockets are very slow
-  transport = TTransport.TBufferedTransport(transport)
+    # Buffering is critical. Raw sockets are very slow
+    transport = TTransport.TBufferedTransport(transport)
 
-  # Wrap in a protocol
-  protocol = TBinaryProtocol.TBinaryProtocol(transport)
+    # Wrap in a protocol
+    protocol = TBinaryProtocol.TBinaryProtocol(transport)
 
-  # Create a client to use the protocol encoder
-  client = Calculator.Client(protocol)
+    # Create a client to use the protocol encoder
+    client = Calculator.Client(protocol)
 
-  # Connect!
-  transport.open()
+    # Connect!
+    transport.open()
 
-  client.ping()
-  print('ping()')
+    client.ping()
+    print('ping()')
 
-  sum = client.add(1,1)
-  print(('1+1=%d' % (sum)))
+    sum = client.add(1, 1)
+    print(('1+1=%d' % (sum)))
 
-  work = Work()
+    work = Work()
 
-  work.op = Operation.DIVIDE
-  work.num1 = 1
-  work.num2 = 0
+    work.op = Operation.DIVIDE
+    work.num1 = 1
+    work.num2 = 0
 
-  try:
-    quotient = client.calculate(1, work)
-    print('Whoa? You know how to divide by zero?')
-  except InvalidOperation as e:
-    print(('InvalidOperation: %r' % e))
+    try:
+        quotient = client.calculate(1, work)
+        print('Whoa? You know how to divide by zero?')
+        print('FYI the answer is %d' % quotient)
+    except InvalidOperation as e:
+        print(('InvalidOperation: %r' % e))
 
-  work.op = Operation.SUBTRACT
-  work.num1 = 15
-  work.num2 = 10
+    work.op = Operation.SUBTRACT
+    work.num1 = 15
+    work.num2 = 10
 
-  diff = client.calculate(1, work)
-  print(('15-10=%d' % (diff)))
+    diff = client.calculate(1, work)
+    print(('15-10=%d' % (diff)))
 
-  log = client.getStruct(1)
-  print(('Check log: %s' % (log.value)))
+    log = client.getStruct(1)
+    print(('Check log: %s' % (log.value)))
 
-  # Close!
-  transport.close()
+    # Close!
+    transport.close()
 
-except Thrift.TException as tx:
-  print(('%s' % (tx.message)))
+if __name__ == '__main__':
+    try:
+        main()
+    except Thrift.TException as tx:
+        print(('%s' % (tx.message)))
diff --git a/tutorial/py/PythonServer.py b/tutorial/py/PythonServer.py
index 8ef231b..a02a525 100755
--- a/tutorial/py/PythonServer.py
+++ b/tutorial/py/PythonServer.py
@@ -19,12 +19,13 @@
 # under the License.
 #
 
-import sys, glob
+import glob
+import sys
 sys.path.append('gen-py')
 sys.path.insert(0, glob.glob('../../lib/py/build/lib*')[0])
 
 from tutorial import Calculator
-from tutorial.ttypes import *
+from tutorial.ttypes import InvalidOperation, Operation
 
 from shared.ttypes import SharedStruct
 
@@ -33,65 +34,67 @@
 from thrift.protocol import TBinaryProtocol
 from thrift.server import TServer
 
+
 class CalculatorHandler:
-  def __init__(self):
-    self.log = {}
+    def __init__(self):
+        self.log = {}
 
-  def ping(self):
-    print('ping()')
+    def ping(self):
+        print('ping()')
 
-  def add(self, n1, n2):
-    print('add(%d,%d)' % (n1, n2))
-    return n1+n2
+    def add(self, n1, n2):
+        print('add(%d,%d)' % (n1, n2))
+        return n1 + n2
 
-  def calculate(self, logid, work):
-    print('calculate(%d, %r)' % (logid, work))
+    def calculate(self, logid, work):
+        print('calculate(%d, %r)' % (logid, work))
 
-    if work.op == Operation.ADD:
-      val = work.num1 + work.num2
-    elif work.op == Operation.SUBTRACT:
-      val = work.num1 - work.num2
-    elif work.op == Operation.MULTIPLY:
-      val = work.num1 * work.num2
-    elif work.op == Operation.DIVIDE:
-      if work.num2 == 0:
-        x = InvalidOperation()
-        x.whatOp = work.op
-        x.why = 'Cannot divide by 0'
-        raise x
-      val = work.num1 / work.num2
-    else:
-      x = InvalidOperation()
-      x.whatOp = work.op
-      x.why = 'Invalid operation'
-      raise x
+        if work.op == Operation.ADD:
+            val = work.num1 + work.num2
+        elif work.op == Operation.SUBTRACT:
+            val = work.num1 - work.num2
+        elif work.op == Operation.MULTIPLY:
+            val = work.num1 * work.num2
+        elif work.op == Operation.DIVIDE:
+            if work.num2 == 0:
+                x = InvalidOperation()
+                x.whatOp = work.op
+                x.why = 'Cannot divide by 0'
+                raise x
+            val = work.num1 / work.num2
+        else:
+            x = InvalidOperation()
+            x.whatOp = work.op
+            x.why = 'Invalid operation'
+            raise x
 
-    log = SharedStruct()
-    log.key = logid
-    log.value = '%d' % (val)
-    self.log[logid] = log
+        log = SharedStruct()
+        log.key = logid
+        log.value = '%d' % (val)
+        self.log[logid] = log
 
-    return val
+        return val
 
-  def getStruct(self, key):
-    print('getStruct(%d)' % (key))
-    return self.log[key]
+    def getStruct(self, key):
+        print('getStruct(%d)' % (key))
+        return self.log[key]
 
-  def zip(self):
-    print('zip()')
+    def zip(self):
+        print('zip()')
 
-handler = CalculatorHandler()
-processor = Calculator.Processor(handler)
-transport = TSocket.TServerSocket(port=9090)
-tfactory = TTransport.TBufferedTransportFactory()
-pfactory = TBinaryProtocol.TBinaryProtocolFactory()
+if __name__ == '__main__':
+    handler = CalculatorHandler()
+    processor = Calculator.Processor(handler)
+    transport = TSocket.TServerSocket(port=9090)
+    tfactory = TTransport.TBufferedTransportFactory()
+    pfactory = TBinaryProtocol.TBinaryProtocolFactory()
 
-server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)
+    server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)
 
-# You could do one of these for a multithreaded server
-#server = TServer.TThreadedServer(processor, transport, tfactory, pfactory)
-#server = TServer.TThreadPoolServer(processor, transport, tfactory, pfactory)
+    # You could do one of these for a multithreaded server
+    # server = TServer.TThreadedServer(processor, transport, tfactory, pfactory)
+    # server = TServer.TThreadPoolServer(processor, transport, tfactory, pfactory)
 
-print('Starting the server...')
-server.serve()
-print('done.')
+    print('Starting the server...')
+    server.serve()
+    print('done.')
