Online Python is a web-based tool to run Python scripts/codes online. It provides a platform-independent Python IDLE & and compiler that enables you to run Python scripts in mobile, tablet, laptop, desktop PC, etc. in a wide range of operating systems including (but not limited to): iOS, Android, Windows, Mac, etc.
Test Your Python Online This tool allows you to run any Python demo code online and helps you to test any python code from your browser without any configuration. This tool provides you any Python version from Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 and runs your Python code in our sandbox environment. OnlineGDB is online IDE with python compiler. Quick and easy way to compile python program online. It supports python3.
Online Python is a web-based tool to run Python scripts/codes online. It provides a platform-independent Python IDLE & and compiler that enables you to run Python scripts in mobile, tablet, laptop, desktop PC, etc. In a wide range of operating systems including (but not limited to): iOS, Android, Windows, Mac, etc. Put Interactive Python Anywhere on the Web. Customize the code below and Share! Turtle Adding or removing images is disabled during broadcasting. You'll be able to update images again once the broadcast session is over. Images listed here are available to use in your code in this trinket.
The online Python comes with a wide range of pre-installed Python packages and you can import Python packages when you execute Python scripts online! So, it is an ideal tool to save your time and learn or execute a wide range of Python codes without the need to install Python and many common Python packages!
Python Online IDLE & Compiler
To use this tool, just remove the sample codes in the following console, write your own script and press run!
# Sample Code:
# To run your Python script, just remove the following codes and write your own!
# When you finished, press RUN to execute your Python codes!
# Hint: You can import many Python packages!
import numpy as np
import matplotlib.pyplot as plt
# Hint: You can run many Python commands!
x = np.arange(0, 5, 0.1);
y = np.sin(x)
plt.plot(x, y)
plt.show()
# The plot will be shown in
# To see the Python console, go to IPython Shell tab:
print(x)
print (y)
Related
Run code in Atom!
Run scripts based on file name, a selection of code, or by line number.
Currently supported grammars are:
Grammar | File Based | Selection Based | Required Package | Required in PATH | Notes |
---|---|---|---|---|---|
Assembly (NASM) | Yes | Yes | language-x86-64-assembly | nasm , binutils | |
1C (BSL) | Yes | language-1c-bsl | oscript | ||
Ansible | Yes | language-ansible | ansible-playbook | ||
AutoHotKey | Yes | Yes | language-autohotkey | AutoHotKey.exe | |
AppleScript | Yes | Yes | language-applescript | osascript | |
BabelES6 JS | Yes | Yes | language-babel | node | |
Bash | Yes | Yes | Runs if your SHELL or #! line is bash . | ||
Bats (Bash Automated Test System) | Yes | Yes | language-bats | bats | |
Windows Batch (cmd.exe ) | Yes | language-batch/file | |||
Behat | Yes | behat-atom | behat | ||
BuckleScript | Yes | Yes | bs-platform | bsc | |
C | Yes | Yes | xcrun clang /cc | Available only on macOS and Linux. | |
C# | Yes | Yes | csc.exe | ||
C# Script | Yes | Yes | scriptcs | ||
C++ | Yes | Yes | xcrun clang++ /g++ | Available only on macOS and Linux. Run with -std=c++14 . | |
Clojure | Yes | Yes | lein exec | Requires Leiningen with the lein-exec plugin. | |
CoffeeScript (Literate) | Yes | Yes | coffee | ||
Crystal | Yes | Yes | language-crystal-actual | crystal | |
Cucumber (Gherkin) | Yes | language-gherkin | cucumber | ||
D | Yes | Yes | language-d | rdmd | |
Dart | Yes | Yes | dartlang | dart | |
DOT (Graphviz) | Yes | Yes | language-dot | dot | |
Elixir | Yes | Yes | language-elixir | elixir | |
Erlang | Yes | language-erlang | erl | Limited selection based runs only (see #70). | |
F* | Yes | atom-fstar | fstar | ||
F# | Yes | language-fsharp | fsharpi /fsi.exe | ||
Fish | Yes | Yes | language-fish-shell | fish | |
Forth | Yes | language-forth | gforth | ||
Fortran | Yes | language-fortran | gfortran | ||
Gnuplot | Yes | language-gnuplot-atom | gnuplot | ||
Go | Yes | go | |||
Groovy | Yes | Yes | language-groovy | groovy | |
Haskell (Literate) | Yes | Yes | language-haskell | runhaskell /ghc | |
HTML | Yes | Opens the current HTML file in your default browser. | |||
Hy | Yes | Yes | language-hy | hy.exe | |
IcedCoffeeScript | Yes | Yes | language-iced-coffee-script | iced | |
Inno Setup | Yes | language-innosetup | ISCC.exe | ||
Idris | Yes | language-idris | idris | ||
io | Yes | Yes | atom-language-io | io | |
Java | Yes | *jdk1.x.x_xxbin | Project directory should be the source directory; subfolders imply packaging. | ||
Javascript | Yes | Yes | node | ||
JavaScript for Automation (JXA) | Yes | Yes | language-javascript-jxa | osascript -l JavaScript | Available on macOS only. |
Jolie | Yes | language-jolie | jolie | ||
Julia | Yes | Yes | language-julia | julia | |
Kotlin | Yes | Yes | language-kotlin | kotlinc | |
LAMMPS | Yes | language-lammps | lammps | Available only on macOS and Linux. | |
LaTeX | Yes | language-latex | latexmk | ||
LilyPond | Yes | atlilypond | lilypond | ||
Lisp | Yes | Yes | language-lisp | sbcl | Selection based runs are limited to a single line. |
LiveScript | Yes | Yes | language-livescript | lsc | |
Lua | Yes | Yes | language-lua[-wow] | lua | |
Makefile | Yes | Yes | |||
MATLAB | Yes | Yes | language-matlab | matlab | |
MIPS | Yes | language-mips | spim | ||
MongoDB | Yes | Yes | language-mongodb | mongo | |
MoonScript | Yes | Yes | language-moonscript | moon | |
NCL | Yes | Yes | language-ncl | ncl | Scripts must end with an exit command for file based runs. |
newLISP | Yes | Yes | language-newlisp | newlisp | |
Nim[Script] | Yes | language-nim | nim | ||
NSIS | Yes | Yes | language-nsis | makensis | |
Objective-C[++] | Yes | xcrun clang [++ ] | Available on macOS only. | ||
OCaml | Yes | language-ocaml | ocaml | ||
Octave | Yes | Yes | language-matlab | octave | |
Oz | Yes | Yes | language-oz | ozc | |
Pandoc Markdown | Yes | language-pfm | panzer | ||
Pascal | Yes | Yes | language-pascal | fpc | |
Perl | Yes | Yes | |||
PHP | Yes | Yes | |||
PostgreSQL | Yes | Yes | language-pgsql | psql | Connects as user PGUSER to database PGDATABASE . Both default to your operating system's USERNAME , but can be set in the process environment or in Atom's init file: process.env.PGUSER = {user name} and process.env.PGDATABASE = {database name} |
POV-Ray | Yes | atom-language-povray | povengine /povray | ||
PowerShell | Yes | Yes | language-powershell | powershell | |
Processing | Yes | processing-language | processing-java | ||
Prolog | Yes | language-prolog | swipl | Scripts must contain a rule with the head main (e.g.main:- parent(X,lucas),writeln(X). ). The script is executed with the goal main and exits after the first result is found. The output is produced by the writeln/1 predicates. | |
PureScript | Yes | language-purescript | pulp | ||
Python | Yes | Yes | |||
R | Yes | Yes | language-r | Rscript | |
Racket | Yes | Yes | language-racket | racket | |
Raku | Yes | Yes | raku | ||
Reason | Yes | Yes | language-reason | rebuild | |
Ren'Py | Yes | No | language-renpy | renpy | Runs your project at the root of the current file. |
Robot Framework | Yes | No | language-robot-framework | robot | The output location depends on the CWD behaviour which can be altered in settings. |
RSpec | Yes | Yes | language-rspec | rspec | |
Ruby | Yes | Yes | |||
Ruby on Rails | Yes | Yes | |||
Rust | Yes | language-rust | rustc | ||
Sage | Yes | Yes | language-sage | sage | |
Sass/SCSS | Yes | sass | |||
Scala | Yes | Yes | language-scala | scala | |
Scheme | Yes | Yes | langauge-scheme | guile | |
Shell Script | Yes | Yes | SHELL | Runs according to your default SHELL , or #! line. | |
Standard ML | Yes | language-sml | sml | ||
Stata | Yes | Yes | language-stata | stata | |
Swift | Yes | language-swift | swift | ||
Tcl | Yes | Yes | language-tcltk | tclsh | |
TypeScript | Yes | Yes | ts-node | ||
VBScript | Yes | Yes | language-vbscript | cscript | |
Zsh | Yes | Yes | Runs if your SHELL or #! line is zsh . |
NOTE: Some grammars may require you to install a custom language package.
You only have to add a few lines in a PR to support another.
Installation
apm install script
or
Search for script
within package search in the Settings View.
Atom can't find node | ruby | python | my socks
Make sure to launch Atom from the console/terminal. This gives atom all your useful environment variables. Additionally, make sure to run it with the project path you need. For example, use
to get it to run with the current directory as the default place to run scripts from.
If you really wish to open atom from a launcher/icon, see this issue for a variety of workarounds that have been suggested.
Python Run Another Python Script
Usage
Make sure to run atom
from the command line to get full access to your environment variables. Running Atom from the icon will launch using launchctl's environment.
Script: Run will perform a 'File Based' run when no text is selected (default).
Script: Run while text is selected will perform a 'Selection Based' run executing just the highlighted code.
Script: Run by Line Number to run using the specified line number. Note that if you select an entire line this number could be off by one due to the way Atom detects numbers while text is selected.
Script: Configure Script should be used to configure command options, program arguments, and environment variables overrides. Environment variables may be input into the options view in the form VARIABLE_NAME_ONE=value;VARIABLE_NAME_TWO='other value';VARIABLE_NAME_3='test'
.
Also, in this dialog you can save options as a profile for future use. For example, you can add two profiles, one for python2.7
and another for python3
and run scripts with a specified profile, which will be more convinient than entering options every time you want to switch python versions.
Change Default Language by opening Atom Settings as follows: Atom→Preferences→Open Config Folder
. Then, you can use the tree-view to navigate to and open packages→script→lib→grammar→python.js
to make your edits. It is also possible to directly edit the code under .atom/packages/script/lib/grammars/python.js
Script: Run With Profile allows you to run scripts with saved profiles. Profiles can be added in Script: Run Options dialog.
Script: Kill Process will kill the process but leaves the pane open.
Script: Close View closes the pane and kills the process.
To kill everything, click the close icon in the upper right and just go back tocoding.
Script: Copy Run Results copies everything written to the output pane to theclipboard, allowing you to paste it into the editor.
Command and shortcut reference
Online Python Script Runner Download
Command | macOS | Linux/Windows | Notes |
---|---|---|---|
Script: Run | cmd-i | shift-ctrl-b | If text is selected a 'Selection Based' is used instead of a 'File Based' run |
Script: Run by Line Number | shift-cmd-j | shift-ctrl-j | If text is selected the line number will be the last |
Script: Run Options | shift-cmd-i | shift-ctrl-alt-o | Runs the selection or whole file with the given options |
Script: Run with profile | shift-cmd-k | shift-ctrl-alt-b | Runs the selection or whole file with the specified profile |
Script: Close View | esc or ctrl-w | esc | Closes the script view window |
Script: Kill Process | ctrl-c | ctrl-q | Kills the current script process |
Replacements
The following parameters will be replaced in any entry in args
(command and program arguments). They should all be enclosed in curly brackets {}
{FILE_ACTIVE}
- Full path to the currently active file in Atom. E.g./home/rgbkrk/atom-script/lib/script.coffee
{FILE_ACTIVE_PATH}
- Full path to the folder where the currently active file is. E.g./home/rgbkrk/atom-script/lib
{FILE_ACTIVE_NAME}
- Full name and extension of active file. E.g.,script.coffee
{FILE_ACTIVE_NAME_BASE}
- Name of active file WITHOUT extension. E.g.,script
{PROJECT_PATH}
- Full path to the root of the project. This is normally the path Atom has as root. E.g/home/rgbkrk/atom-script
Parameters are compatible with atom-build
package.
Development
This is an Open Open Source Project, which means:
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit.
As for coding and contributing, rely on the atom contributing guidelines.They're pretty solid.
Quick and dirty setup
apm develop script
This will clone the script
repository to ~/github
unless you set theATOM_REPOS_HOME
environment variable.
I already cloned it!
If you cloned it somewhere else, you'll want to use apm link --dev
within thepackage directory, followed by apm install
to get dependencies.
Online Python Script Runner
Workflow
After pulling upstream changes, make sure to run apm update
.
Online Python Script Runner
To start hacking, make sure to run atom --dev
from the package directory.Cut a branch while you're working then either submit a Pull Request when doneor when you want some feedback!