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.
- Open a source file.
- Hit
F5
orF6
to run.
- It will save the file in current editor immediately without a confirmation, be aware.
- Using
python
- Almost the same console with python IDLE, which provides syntax error and runtime error messages.
- CodeBlocks debug console style
- Shows return value and execution time
- It is a rough time based on real time rather than CPU kernel / user time
- Shows return value and execution time
-
Extension filter
- Accepts all file extensions by default (empty value), you can change it into
.py
- or an array
.py, .js, .something-else
- or an array
- Accepts all file extensions by default (empty value), you can change it into
-
Command
- You can hack it using these variant, or
{file}
={dir}/{name}{ext}
- Run with interactive mode, or
python -i {file}
- Run with idle, and you may need the next setting.
pythonw C:\python27\Lib\idlelib\idle.pyw -r {file}
- Pass arguments
python {file} these are arguments for file
- Pause
- Show elapsed time and pause
cp
- Exit immediately
- You can disable the default cp wrapper if you don't want it.
- Show elapsed time and pause
- You can hack it using these variant, or
-
Pipe to File
- Redirect standard output to a file instead of the screen
- Name the path and file to write to
/some/file/path/to/my-programs-output.txt
- Create the file in the current working directory by omitting a path
my-programs-output.txt
- Name the path and file to write to
- Redirect standard output to a file instead of the screen
-
Terminal
- Left empty by default (uses the systems default terminal)
- Choose the type of terminal you'd like to use instead
terminator, -x
-
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 havepython3.x.x
installed). Please report anypython3
issues if you want to avoid installing a globalpython2
version.
- Note: If you have problems executing, you can install a global version of latest
- Before newing an issue, check to see if someone else is experiencing any related issues.
- Check to see if any issues that were closed resemble your issue and re-open it addressing that you're experiencing a similar issue.
- Provide details about your issue, such as errors and/or logs.
- Provide reproduction steps (we can't help you if we don't know how to reproduce the error!).
-
The
atom-python-run
plug-in fully supports logging.- Please post these logs along with any issue you're experiencing (we can't help you if we don't know what's happening!).
- Note that there are 2 logs in case the latter fails. The first log is the console log and the second log is created by the cp main.py executable.
-
How to access Atoms Console Log
- Windows/Linux
- Ctrl + Shift + I
- Mac OS X
- Cmd + Alt + I
- Click on the
console
tab - Copy and paste the console output along with your post.
- Windows/Linux
-
How to access
cp
's built-in log- Windows
- Open file explorer
- Click the location bar (where the file path usually is)
- Type in
%userprofile%\.atom\packages\atom-python-run
- Locate, Open, and Copy the contents of the cp.log file along with your post.
- Mac OS X/Linux
- Open a terminal window.
$ cat ~/.atom/packages/atom-python-run/cp.log
- Copy and paste the contents along with your post.
- NOTE: If the
cp.log
file is missing, empty, or inaccurate, please note that this was case in your post.
- Windows
-
Detailed issues are well presented issues. This will help us remedy the problem.
- New an issue if you have any idea of new features.
This is a package for Atom