Atom python mac os

20 ATOM Plug-ins For Python Development

1. IDE-python package

  • Jedi for Completions, Definitions, Hover, References, Signature Help, and Symbols
  • Rope for Completions and renaming
  • Pyflakes linter to detect various errors
  • McCabe linter for complexity checking
  • pycodestyle linter for style checking
  • pydocstyle linter for docstring style checking
  • autopep8 for code formatting (preferred over YAPF)
  • YAPF for code formatting

Installation Language Server Install the language server (0.19.0 or newer) with.

This command will install the language server and all supported feature providers, which can be enabled or disabled in the settings.

You can verify that everything is correctly installed by running python -m pyls —help from the command line. It should return

If you have installed pyls using a non default installation of Python, you can add modify the Python Executableconfig in the ide-python settings.

Atom Package Install ide-python and atom-ide-ui from Install in Atom’s settings or run.

    pycodestyle: discovered in

/.config/pycodestyle, setup.cfg, tox.ini and pycodestyle.cfg
flake8: discovered in

/.config/flake8, setup.cfg, tox.ini and flake8.cfg

The configuration is computed first from user configuration (in home directory), overridden by configuration in the ide-python settings, and then overridden by configuration discovered in the current project.

2. atom-python-run package

Run your python (.py) source file using F5 or F6!

  • Atom Text Editor (nightly or latest stable release)
  • Python 2 and/or 3
  • Add Python (and any other interpreters) to the PATH environment variable. Features
  • Using python
  • Almost the same console with python IDLE, which provides syntax error and runtime error messages.
  • It is a rough time based on real time rather than CPU kernel / user time
  • Cross Platform Compatible
  • Runs on Windows, Mac OS X, and Linux
  • True Arbitrary Execution
  • Global python is the default interpreter
  • Execute using any interpreter
  • Pass options to the given interpreter
  • Pass arguments to the program to be executed
  • Python 2 and 3

Note: If you have problems executing, you can install a global version of latest python2.7.x (even if you have python3.x.x installed). Please report any python3 issues if you want to avoid installing a global python2 version.

3. Python Black for Atom editor

Uses Black for formatting Python code.

Requirements Make sure you have black installed and the correct path to binary was set in the package config.

Keymap “ctrl-alt-c”: “python-black:format” Configuration

4. Python Tools

Details This package uses Jedi in addition to other custom code to provide numerous pieces of functionality to make you more productive: Show Usages Default shortcut: ctrl+alt+u

Select the usages of a specific symbol in your file. This is for handy for quickly refactoring/renaming variables and other symbols within your code. Currently only supports detection of symbols within the same file. This will be extended to support usages outside the current file in the future. Goto Definition Default shortcut: ctrl+alt+g

Читайте также:  Где лежат обновления mac os

Go to to the original definition of the symbol under the cursor. This will open the corresponding file if it is not already open. Files which form part of the standard library / are installed as third party modules are still opened, which is a really nice way of analysing and understanding behavior of code. Select String Contents Default shortcut: ctrl+alt+e

Select the entire contents of the string currently being selected. Works with single line as well as block strings.

5. atom-python-yapf

Atom.io plugin to format Python files using Google’s YAPF

Install apm install python-yapf Or Settings/Preferences ➔ Packages ➔ Search for python-yapf Make sure you have YAPF installed and the correct path to binary was set in the package config. Settings

Keymap Currently, there are two commands: python-yapf:formatCode — for formatting python code python-yapf:checkCode — for checking format of python code

6. build-python

Installation apm Install build-python from Atom’s Package Manager or the command-line equivalent:

Using Git Change to your Atom packages directory:

Clone repository as build-python:

Inside the cloned directory, install Node dependencies:

Build Before you can build, select an active target with your preferred build option. Available targets:

  • Python — compile script
  • Python (compileall) — compile script with -m compileall
  • Python (compileall, optimized) — compile script with -O -m compileall
  • Python (user) — compile script with custom settings (interpreter and/or arguments) Shortcuts Here’s a reminder of the default shortcuts you can use with this package:
  • Select active target Cmd+Alt+T or F7
  • Build script Cmd+Alt+B or F9
  • Jump to error Cmd+Alt+G or F4
  • Toggle build panel Cmd+Alt+V or F8

7. Atom-Python-test

  • You need py.test installed to use this package:
  • When using virtualenv, the recommended workflow is:
  • Activate your virtualenv on terminal.
  • Run atom editor, so this plug-in will get py.test from virtualenv (or use atom-python-virtualenv plug-in). Usage 1) Running all tests (Ctrl + Alt + T) 2) Run test under cursor (Ctrl + Alt + C) 3) Hide the execution panel (Ctrl + Alt + H)

The plug-in supports to color the output: tests passed in green and failed in red and also supports to add more execution parameters in the settings.

8. run-python-simply package

Run a python file in cmd or Powershell or other Linux terminals.

  1. Open a .py file.
  2. Press F5 to run.
  • cmd or Powershell
  • Two options for you, cmd and powershell. Choose one you like!
  • CodeBlocks debug console style
  • Show return value and execution time

Config The commands use as a placeholder for the file to run. I redesign the commands format to support linux systems in the future. Now Windows cmd and powershell are available.

9. python-indent

Python Indent is the indentation behavior you’ve been waiting for in Atom! You should no longer have to worry about mashing your tab/space/backspace key every time you press enter in the middle of coding. Also, compared to other editors, there is no need to change an app configuration if you want to have a mixture of different types of indents (namely hanging and opening-delimiter-aligned).

Читайте также:  Windows api параметры системы

The main obstacle with Atom’s native indentation behavior is that it doesn’t yet have the necessary API’s to do what Python’s PEP8 style guide suggests. Enhancement requests and issues have been opened in Atom Core on a few occasions, but none have been resolved yet.

This package was made to give you expected indentation behavior; python-indent listens for editor:newlineevents in Python source files, and when triggered, adjusts the indentation to be lined up relative to the opening delimiter of the statement or “hanging” (for parameters, tuples, or lists).

Indent Types Both indent types for continuing lines as described in PEP 0008 — Style Guide for Python Code are auto-detected and applied by this package.

  • Aligned with Opening Delimiter
  • def function_with_lots_of_params(param_1, param_2, param_3, param_4, very_long_parameter_name, param_6) def function_with_lots_of_params( param_1, param_2, param_3, param_4, very_long_parameter_name, param_6)
  • Setting
  • Hanging Indent Tabs: Number of tabs used for hanging indents

10. python-mrigor package

Integration of mr.igor in atom!

mr.igor is an extension to pyflakes that will learn where you import things from, and then automatically fill in missing imports from the place they are most often imported.

This package integrates mr.igor in your atom editor. Just install mr.igor in your system (pip install mr.igor), and then install this package in atom.

Whenever you save a python file, mr.igor will save all imports, so that you can remember them in any other python file just pushing ctrl-alt-i

11. Python-Debugger package

  • alt-r/option-r: hide/show the debugger view
  • alt-shift-r/option-shift-r: toggle breakpoint at the current line
  1. Install using APM $ apm install python-debugger language-python The language-pythonpackage provides syntax highlighting
  2. Open the Python file to debug and insert breakpoints
  3. Press alt-r to show the debugger view
  4. Insert input arguments in the input arguments field if applicable
  5. Hit the Run button. Focus moves to the first breakpoint.
  6. Use the buttons provided to navigate through your source. You can enter debugger commands directly in the command field.

The current version should support Python 2.5 and higher, including Python 3. The Python executable to be used while debugging can be changed in the settings.

Источник

Настройка Atom от GitHub для работы с PHP, Python и некоторыми другими языками программирования

Изначально считаем что у Вас установлена поддерживаемая операционная система, Node.JS и Atom. В примерах мы работаем в OpenSUSE (13.1) в нём (и вообще в дистрибутивах *nix) уже «из коробки» обычно есть не только Python но PHP и другие языки программирования. Так же исправно работает на Ubuntu (>12.04). Если у Вас Windows 7 или 8, а раньше Вы с ними (языками) не работали то их предварительно необходимо скачать и установить.
Примечание: перед началом работы желательно запускать Atom под root.
опыт показывает — работает стабильнее

Читайте также:  Переместить папку windows с диска с

Linter

Идеология Atom к подсветке в том, что основным пакетом для работы с синтаксисом и его анализа будет Linter, который является верхним уровнем в API для других линтеров кода. Это сделано для прекращения «войны между плагинами» (The idea is to stop the linter plugins war, by providing a top level API for linters to parse and display errors in the Atom editor). Тем не менее, не все сторонние разработчики придерживаются этой идеологии и пишут свои плагины.

  • linter-php , для PHP `php -l`
  • linter-phpcs , для PHP, `phpc`
  • linter-phpmd , для PHP, `phpmd`
  • linter-pylint , для Python, `pylint`
  • linter-pyflakes , для python, `pyflakes`
  • linter-pep8, для python, `pep8`
  • linter-flake8, для python, `flake8`
  • linter-javac , для Java, `javac`
  • linter-jshint , для JavaScript and JSON, `jshint`
  • linter-jscs , для JavaScript, `jscs`
  • linter-scss-lint , для SASS/SCSS, `scss-lint`
  • linter-coffeelint , для CoffeeScript, `coffeelint`
  • linter-csslint , для CSS, `csslint`
  • linter-rubocop , для Ruby and Ruby on Rails, `rubocop`
  • linter-tslint , для Typescript, `tslint`
  • linter-xmllint , для XML, `xmllint`
  • linter-shellcheck , для Bash, `shellcheck`
  • linter-scalac , для Scala, `scalac`
  • linter-clang , для C / C++, `clang`
  • linter-ruby , для ruby, `ruby -wc`
  • linter-lua , для Lua, `luac -p`

Пакет Script: запуск программ из Atom

Script — пакет для запуска кода в atom.

Установка пакета Script, возможна из командной строки:

или меню
Packages->Settings View->Install->Packages

Каждый язык работает, при наличии предварительно установленного компилятора / интерпритатора.
Пакет Script обновляется довольно часто. Например поддержка Swift появилась менее двух недель назад. Так что скорее всего в ближайшее время появится поддержка новых языков.

Для запуска программы необходимо выбрать
Packages—>Script—>Run

Дополнительные опции можно найти в документации либо на страницах Atom`а или проекта.

Для функционирования должен быть создан рабочий каталог.
Путь к нему нужно прописать здесь:
Packages—>Script—>Configure Script—>Current Working Directory
Заявку разработчикам на поддержку нового языка можно оставить здесь (отвечают быстро)

И немного юмора от разработчиков пакета Script,
у которых, судя по всему, спрашивают всё на свете:

первод: Атом не может найти Нод | Руби | Питон | Мои носки

Python

Поддержка подсветки этого языка идёт изначально. Пакеты для работы с синтаксисом и отладки:
Linter + Language Python + Linter Python Pep8 + Script

Script запускает код на Python, а Linter и Linter Python Pep8 покажут синтаксические ошибки.
Возможно Вам, для работы с Python также поможет Atom Python Debugger.
Подсветка ошибок и запуск после установки будут выглядеть так:

Swift

Терминал

Для запуска исполняемого кода С, C++, Java иногда проще использовать сторонний пакет (не пакет Atom, а пакет вашего дистрибутива), который запускается через терминал, поскольку сам Atom поддерживает большое количество языков. Если Atom выступает в качестве редактора кода, a терминал рядом запускает его — это очень удобно для нас, поскольку терминал не имеет такое преимущество редактирования, как Atom.
Для запуска терминала в окне Atom установите пакет Term. Для запуска терминала в окне Atom выбрать
Packages—>Command Palette—>Toggle и Term
с нужными параметрами.

В заключении ещё один интересный кликабельный анимационный gif от разработчиков script, ссылки.

Источник

Оцените статью