Got tired of PyCharm. Not taking focus with focus-follow-mouse over. Tried Yhat’s Rodeo, but found that it wasn’t developed enough. But a very promising program. Then moved on to Atom. This blog ia mostly for myself, so that I can set it up again when the system crashes.
The installation and setup takes a lot of times. Atom is just a text-editor, and you will have to install some packages before it becomes a Python IDE.
First install Atom. No problems. Now open ‘File’ – ‘Settings’. Click the ‘+ Install’.
- First to install is ‘script‘. A package that makes Atom able to run Python scripts. No problem there.
- Then install ‘autocomplete-python. Name says it all. I choose ‘Jedi’. Nothing further yet.
- Add some nice icons to your project tree. Install ‘file-icons.
- Obey the rules/guidelines: Install ‘python-autopep8‘. More about that later.
- To highlight your errors, if you have any, install ‘linter-flake8‘. Some dependencies, but just click yes to all.
Now the wanted packages are installed, all most. Under settings for some of the modules it was mentioned that additional packages is needed. So three things to do outside Atom.
In ‘System’ – ‘Advanced system settings’ – ‘Environmental variables…’ – ‘User variables for Brian’ edit PATH and add your Python-path if you didn’t do so when installing Miniconda. Mine path is ‘C:\ProgramData\Miniconda3’.
Now open an Anaconda prompt. I have gone back to using the main Python environment for Machine Lerning, so I’ll install the nessesary packages there.
conda install -c conda-forge autopep8
conda install flake8
Now back to Atom to change some settings. Go to ‘File’ – ‘Settings’. Then under ‘Packages’ change the following under settings for the individual packages:
‘Enable Autoscroll’: Untick,
‘View output in the dock by default’: Tick,
‘Leave output dock open’: Tick,
‘Startup Code’: add ‘{“python”: “%matplotlib inline”}’.
‘Python Executable Path’: add ‘C:\ProgramData\Miniconda3\python’.
‘Executable Path’: add ‘C:\ProgramData\Miniconda3\Scripts\flake8’,
‘Ignore Error Codes’: add ‘F401, F841’ (Those are for unused imports and unused variables),
‘Max line Length’: 120.
‘Format On Save’: Tick.
‘Enabled’: Tick.
and disable core-packages ‘autocomplete-snippets’ and ‘welcome’.
Under ‘Core‘ change both ‘Close Empty Window’ and ‘Remove Empty Panes’ to unticked.
‘Font Family’: add ‘source code pro’,
‘Font Size’: 17,
‘Line Height’: 1.6,
‘Preferred Line Length’: 120,
‘Scroll Past End’: Tick,
‘Tab Length’: 4.
In settings for the individual packages under ‘Keybindings’ you will find the shortcut keys for the package. Copy the code for those you’ll change by clicking on the icon to the left.
Go to ‘Settings’ – ‘Keybindings’. Click on the link ‘your keymap file’ in the first line. Paste the code into the file and change to your preferred shortcut keys. Mine looks like this:
'.platform-win32 atom-text-editor, .platform-linux atom-text-editor':
'f5': 'script:run'
'atom-text-editor:not([mini])':
'f6': 'hydrogen:run-and-move-down'
'.platform-win32 atom-text-editor:not([mini]), .platform-linux atom-text-editor:not([mini])':
'ctrl-enter': 'hydrogen:run-and-move-down'
With ‘Hydrogen’ disabled you run your code by ‘F5’, and get the output in the output pane in the bottom. With ‘Hydrogen’ enabled, ‘F5’ doesn’t give any output. Using ‘F6’ or ‘Ctrl’ + ‘Enter’ gives the output in the pane to the right.
Comments are closed.