Skip to main content

Setup Python Environment in Atom

If Atom is your preference text editor and Python 3 is one of your programming language, the blog is for you. It'll show you how to setup Python environment in Atom: edit and run.

OS                 : Debian 9
Python          : 3.5
Atom version: 1.16.0
Atom Plugin :  atom-runner & autosave

the 1st step is Atom installation, I think it should be done on your PC, otherwise, download .deb file from Atom website and install it in terminal as following:
sudo dpkg -i atom-amd64.deb

If problem, fix it with:
sudo apt-get install -f 

The 2nd step is adjust configuration. Open Atom, select 'Edit'-->'Preferences'-->'Editor':
  • Tick 'Show Indent Guide'
  • Change 'Tab Length' to '4'
The 3nd one is adding 'atom-runner' and 'autosave' plugin. Click 'Packages' under 'Preferences' in above step, then search and install 'atom-runner' and 'autosave'.

For 'autosave', click it and tick 'Enabled' under settings.
For 'atom-runner', add following lines in runner configure file under 'Edit-->config':

If you are not sure the python 3 location, check it with 'which' in terminal:

Save it and write a .py file to test running. Press 'Alt+R' for Win/Linux, you'll find result on the right side.







Shortcuts list:
  • Hit Ctrl+R (Alt+R on Win/Linux) to launch the runner for the active window.
  • Hit Ctrl+Shift+R (Alt+Shift+R on Win/Linux) to run the currently selected text in the active window.
  • Hit Ctrl+Shift+C to kill a currently running process.
  • Hit Escape to close the runner window.

Comments

  1. I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. 统计作业代写

    ReplyDelete
  2. Thank you for the article. It helped me writing small tutorial on how we can use Atom for Python environment, what are the packages we should be using etc. Please let me know if I miss something: Atom setup for python

    ReplyDelete

Post a Comment

Popular posts from this blog

Upgrade BeautifulSoup4 to compatible with Python 3.6

After upgraded to Python 3.6 from 3.5, I encountered BeautifulSoup (bs4) error, such as 'ImportError: cannot import name 'HTMLParseError'. Seems there's compatible problem for BeautifulSoup 4 version. Solution: Upgrade beautifulsoup 4 version to 4.6.0 Commands: $ pip3 install --upgrade beautifulsoup4 Deep in: Install pip3 command: $ sudo apt install python3-pip

Atom community packages recommendation for Python development

Below are Atom community packages I installed for Python development. They are covered most of functions u need. Take this post as an backup.  

Solved: Pyperclip could not find a copy/paste mechanism for your system.

OS: Debian 9 Python version: 3.5 After import pyperclip module, encounter error message ' Pyperclip could not find a copy/paste mechanism for your system. '. Solution: install xsel utility $ sudo apt install xsel then reboot Python IDLE3, import pyperclip, solved. *************** Install pip/pyperclip: $ sudo apt install python3-pip $ sudo pip3 install pyperclip