Setting up a Python Environment - TypeClub/opentypefea GitHub Wiki

1 | Text Editor

Yes, I am going to take a whole section to shit on Dreamweaver and convert those who still use it to kick its inbred ass to the curb. If your coding experience has begun with web development the natural starting point is Dreamweaver. It's already packaged with all the other software you've been using so it seems like a clear choice for most. DW has a number of issues, most relevantly it takes a lot of work to get Python working like it should. I'm here to convince you to switch to a new editor that can do anything you want now or in the future, all in one spot. Personally, I think the largest reason DW gets so much shit is that it feels like it was made by Adobe. Their flagship software is all about visually creating things. Recent iterations of DW attempt to take the code out of coding with all the integration with other Creative Suite software and new ways to visualize your code. The development of DW seems to heavily focus on making coding seem as accessible as possible so maybe more people will try it out, which is great, but some users never leave because other editors seem daunting or unfamiliar. But there are far superior editors out that cost less or are even free. DW is bogged down by so many useless features and runs very poorly and struggles with larger files. After using a well made editor, Dreamweaver will feel just as inbred as Joffrey Baratheon looks and the design view is its golden hair.

What text editor you use is up to you, and usually comes down to personal preference. Brackets and Sublime Text are some popular ones that come to mind. If you are unsure of what editor you would like to use, Atom kicks ass. It's extremely versatile and also 100% free and open source. Fun fact: Atom was developed by GitHub! While some of this information is universal across text editors, this wiki will go over Atom specifically. You can get Atom here.

Make Atom Kick More Ass

Here are some important settings in Atom's preferences panel you should change.

Core Settings:

Exclude VCS Ignored Paths: ON

Editor Settings:

Atomic Soft Tabs: ON
Preferred Line Length: 79
Soft Tabs: ON
Tab Length: 4
Tab Type: SOFT

Packages:

Packages are one of my favorite features in Atom. They can be simple ui tweaks or powerful plugins that add new features to make your life much, much easier. You can browse and install new packages under Preferences>Install and manage your packages under Preferences>Packages.

Under the Packages tab, do a search for tree-view. Open the tree view settings and turn on Hide Ignored Names and Hide VCS Ignored Files.

Recommended Editor Settings

Font Family: For me, I have found the default font (Menlo), to be annoying to read over longer sessions especially in complex documents. I used Source Code Pro for a while until I saw someone suggest Roboto Mono and haven't switched since.
Scroll Past End: ON
Show Indent Guide: ON

Recommended Packages

file-icons by file-icons
minimap by atom-minimap
minimap-highlight-selected by atom-minimap
pigments by abe33
If you don't like autocomplete disable autocomplete-plus
Unrelated to what we will be doing, atom-jade by merrihew adds Jade language support, a badass alternate way to write HTML especially when paired with SASS–an alternative to writing CSS. I can't recommend these enough.

Themes

Themes in atom are split into the ui themes and syntax highlighting themes. Theres a ton of good ones out there. This is how I configured my Atom to be easy on the eyes with no bright colors:

UI Theme:
atom-material-ui by atom-material
Color: Blue Grey
Contrasting Panels: ON
Panels Cast Shadows: ON
Use Animations: ON

Syntax Theme:
gruvbox-plus-syntax by Briles
Brightness: Dark
Contrast: Soft
Variant: Default

2 | Python

The latest version of macOS, Sierra, comes with Python 2.7 preinstalled. The further development of Python 2 has ended and Python 2 will retire in 2020. Enter the current production release, Python 3.

Before we install Python 3, we need to install the GNU Compiler Collection (GCC). The recommended method of doing this is to get XCode from the Mac App Store. After it finishes installing, open it and let it perform its first time setup. After it is done you can close XCode. If you perform a fresh install of XCode, you will need to add the command line tools by running xcode-select --install in terminal.

We will need a package manager (pip). Pip comes packaged with an install of Homebrew. To install Homebrew and pip, run /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".

Now we can install Python 3 with brew install python3.
Confirm the install and current version with python3 --version.
Python 3 is now installed.

NOTE: When running pip commands, use pip3 to point to Python 3, using just pip will point to the system Python and we don't want to mess with that.

3 | Python Extras

linter-flake8 by AtomLinter
This is linter for the Python syntax, it acts like a spellcheck to catch any errors in your code. This is not an autocomplete plugin. Installing the package will only install the flake8 plugin in Atom, you will also need it on your system. To do this, run pip3 install flake8 in Terminal.

python-autopep8 by markbaas
After installing in Atom, open the settings for this package and turn on 'Format on Save'. This will automatically format your code to conform to the PEP8 style guidelines every time you save your file. Installing the package will only install the autopep8 plugin in Atom, you will also need it on your system. To do this, run pip3 install autopep8 in Terminal.

Using the pip3 list command, you can view all your installed packages and their versions.

⚠️ **GitHub.com Fallback** ⚠️