Page 295 -
P. 295

mobile app development


           Don’t worry about Python 2


           The fact that Python 2 is available for Android and you’ve learned Python     I’m quite happy
           3 in this book is nothing to lose sleep over. Python 2 is still Python, and the   to run Python 3
           differences between Python 2 and Python 3 are easy to manage.
                                                                                         all day long...
           Think about your webapp for a minute. Right now, the model, view, and
           controller code resides on the web server, which is running Python 3.


            Your web browser
            runs here.




                                                                                          Web
                                                     The Internet
                                                                                         Server






                                                                       All of your webapp
                                                                       code runs here.
           If you move the user interaction to the smartphone, the model and some
           of the controller code stay on the server (and continue to run on Python
           3), whereas the view code and the rest of the controller code move to the
           smartphone, where they need to be rewritten to run on Python 2.                Python 3 is still
                                                                                          going strong...


                Run Python code?
               No problem...just so
               long as it’s Python 2.





                                                                                          Web
                                                      The Internet
                                                                                         Server


               Half your webapp’s
              code runs here…


                                                                        …and the other
                                                                         half runs here.
                                                                                      you are here 4    259
   290   291   292   293   294   295   296   297   298   299   300