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

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.

主站蜘蛛池模板: 东安县| 汤原县| 巫山县| 东莞市| 普陀区| 怀来县| 博兴县| 山阳县| 上饶县| 图们市| 衡山县| 象山县| 白朗县| 平邑县| 麻栗坡县| 凤冈县| 奉化市| 邹城市| 贵南县| 广昌县| 贵溪市| 庐江县| 岑溪市| 大厂| 营口市| 广德县| 郸城县| 伊川县| 内黄县| 云梦县| 丰顺县| 思茅市| 丹寨县| 安塞县| 黎平县| 齐河县| 凤翔县| 溆浦县| 靖宇县| 新巴尔虎右旗| 措美县|