-
Notifications
You must be signed in to change notification settings - Fork 30
12 How Do I Use atom python run
- Introduction
- Pre-Install
- Post-Install
- Settings
- Hello World
- Cant save a buffer with no file
- Console Log
- cp Log
- Console vs cp Log
- Summary
The package it self is actually fairly simple. If you are unfamiliar with how the Command Line Interface (CLI) works, it may be a bit tricky to set, navigate, and manipulate.
That's why I made this Wiki, README, and Guide to walk you through the basics.
This guide is less of a how-to and more of a visual reference than anything else. This way you have a visual aide and know what to look for (in a "physical" sense").
- install python (2 and 3 are both supported)
- make sure to add it to the
PATHenvironment variable during installation. Theres usually a small checkbox that let's you mark this as an option. - use Atom to install atom-python-run.
ctrl + ,will open up the Settings panel.
After you have installed atom-python-run package in Atom, you can manipulate the settings, or you can use the default settings, and begin coding right away.
Let's take a peek at the settings and atom's console first. To open atom's console, press ctrl + alt + i on windows or linux. In mac os x, it's cmd + alt + i. A panel to the right will now be displayed. We can click on the settings button to look at atom-python-run's settings too. We'll leave those for default for now. You can always change them later to suite your needs.
We can move the console to the bottom of the window or detach it all together. Sometimes I detach it so I can see more and get a bit of flexibility. There is no rule or guideline for this. It's just preference.
Like all beginnings in the coding community, we can start off with a hello, world application.
ctrl + n to create a new buffer and panel in atom. Depending on which version of python you installed depends on how you can write it up. I usually go for forwards compatibility over backwards compatibility because python2 will be officially deprecated starting in 2020.
from __future__ import print_function
print('Hello, World!')ctrl + shift + s to save as hello-world.py. then f5 or f6 to execute. atom's console.log will create the initial log first which you can see to right in the image below.
NOTE: Always use a hello, world application for testing atom-python-run. It will simplify everyone's life in the long run.
You can attempt to execute a buffer, but it will fail, and fail miserably. You should always save your source code as a file first and then execute after. Any changes made afterwards can be saved and executed simultaneously. atom-python-run will always attempt to save the file first before executing it. If not, you'll see something like this.
When a problem occurs, you'll want to refer to the logs. They are there to help you, and us (the devs), to isolate the problem that your experiencing.
The first log is Atom's Console Log. You can toggle whether it is on or off in your settings. You can see the output in the console pane to the right.
The second log is the cp log. This log is often confused with the console.log. They are different and log different pieces of information for different reasons. You can find the technical details in the wiki here.
Yes, they are different. One is temporarily written to atom's console. The other is written to a file on your local hard drive (or where ever you installed atom). You can tweak where these files are stored by manipulating the path in source code.
You can do much more with atom-python-run! You can take a look at the settings section of the README.md for more information. If you'd like more technical detail, feel free to poke around the wiki. The wiki is under constant construction, so feel free to add to it, improve it, or fix it so that it's current and relevant to the repo.









