官术网_书友最值得收藏!

Setting up a development environment

Flask is written in Python, so before we can start writing Flask apps we must ensure that Python is installed. Most Linux distributions and recent versions of OSX come with Python pre-installed. The examples in this book will require Python 2.6 or 2.7. Instructions for installing Python can be found at http://www.python.org.

If this is your first time using Python, there are a number of excellent resources available for free on the web. I would recommend Learn Python The Hard Way, by Zed Shaw, available for free online at http://learnpythonthehardway.org. Looking for more? You can find a large list of free Python resources at http://resrc.io/list/10/list-of-free-programming-books/#python.

You can verify that Python is installed and that you have the correct version by running the Python interactive interpreter from a command prompt:

$ python
Python 2.7.6 (default, Nov 26 2013, 12:52:49)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

At the prompt (>>>) type exit() and hit Enter to leave the interpreter.

Supporting Python 3

This book will include code that is compatible with both Python 2 and Python 3 where possible. Unfortunately, since Python 3 is still relatively new as compared to Python 2, not all third-party packages used in this book are guaranteed to work seamlessly with Python 3. There is a lot of effort being put into making popular open-source libraries compatible with both versions but, at the time of writing, some libraries have still not been ported. For best results, ensure that the version of Python that you have installed on your system is 2.6 or above.

主站蜘蛛池模板: 临泽县| 大悟县| 通城县| 恩施市| 金塔县| 通山县| 策勒县| 通化县| 上犹县| 阳曲县| 芦山县| 普洱| 长治县| 耒阳市| 武山县| 湖南省| 南溪县| 盐池县| 南陵县| 定远县| 阜新市| 东台市| 化德县| 兰州市| 惠水县| 麻江县| 竹山县| 华池县| 新和县| 堆龙德庆县| 博湖县| 桐梓县| 绵竹市| 晋江市| 五原县| 芦山县| 临汾市| 仁怀市| 邵武市| 南江县| 红桥区|