#Starting Python Web development in Mac OS X#
Objective: Getting started with Python DevelopmentOperating System: Mac OS XPython version installed: 3.5 (5th December 2015)
The tutorials, NEURON, and the browser Firefox are bundled together for an easy one-step drag and drop installation. For computers running Mac OS 10.3 and Windows, this package includes a Mac OS X native version of NEURON. For Mac OS 9, 10.1 and 10.2, NIA 1.45 employs the Mozilla browser and a version of NEURON running in OS9/Classic.
Downoad the lastest Python from https://www.python.org/downloads/
Mac OS uses default 2.x version out of box.To check whether, python has been installed successfully. try the following command.
Above step ensure that Python 3.5 has been installed successfully.
This is the high level outline of this post:Mas OS X -> Python 3.5 -> Virtaulenv -> Flask --> app.py(first Hello world )
Installing virtaulenv: (Step 1 ofWhy use virtualenv?
- Having different version of libraries for different projects
- Solves the elevated privillege issue as virtualenv allows you to install with user permission
Now lets create the first flask app
Now we will create a virtualenv
If you list the contents of the hello_flask directory, you will see that it has created several sub-directories, including a bin folder (Scripts on Windows) that contains copies of both Python and pip. The next step is to activate your new virtualenv.
Installing Flask in your virtaulenv
Hello, Flask
![Mac Mac](/uploads/1/2/5/8/125854491/446406129.png)
Create a new file called app.py
Open the web browser with
http://localhost:5000