Try Python in Your Browser With These Free Online Interactive Shells
If you’re thinking of learning Python, you might be overwhelmed by the initial setup process. You need to install Python on your system, then learn how to use the command line to process code, or learn how to use the interactive shell, or learn how to set up a Python IDE.
Ignore all of that. It’s unnecessary until you know whether Python is right for you.
Instead, we recommend using an online interactive shell, which is just a website that lets you write and execute Python code and instantly see the results. No need to install anything. So whether you’re going through these Python examples or reviewing the basics of arrays and lists , you can test the code right in your browser. Here are the best online Python interpreters we’ve found.
If there’s one reason why Python Anywhere beats every other online Python interpreter, it’s that it supports IPython. IPython is a more advanced alternative to the default Python interpreter. With it, you get a bunch of useful features: tab completion while typing, the ability to “see” the variables and methods of an object in real-time, read inline module documentation, and more.
None of this is strictly necessary, of course. If you’re a complete beginner, you may want to skip over it for now and come back in a few weeks when you’re more comfortable. But as far as Python interpreters go, IPython is the standard for productivity.
Note: Python Anywhere is actually much more than this. It’s a full-blown web IDE that lets you create and host Python apps on the web. This “Try IPython” page is just a nifty little side tool.
Python Fiddle is the one I’d recommend to anyone who has experience in programming but no experience in Python. The interface is quite simple and easy to use, but more importantly, it comes with a bunch of example code that you can load in with a single click.
By exploring the left sidebar, you’ll learn some of the coolest tips and tricks that make Python more fun to use than other languages . Or you can type in your own code, run it, and see the results in the output section at the bottom.
Note that you can also “save and share” the code you’ve written. This can come in handy if you have a mentor to help you with debugging, or if you’re collaborating with others on a project.
The name Repl.it comes from REPL, which stands for “Read-Eval-Print Loop” (essentially a synonym for “interactive shell” so don’t be confused). Repl.it supports dozens of languages, including both Python 2.x and Python 3.x, so if you decide that Python isn’t for you, you can still use it when learning C#, Java, Ruby, Lua, ES6, and more.
What I like best is its customizability. You can tweak the layout, color theme, font size, indent size, wrap type, and whether to enable autocomplete. The interface is straightforward. And if you create an account, you can save your code and pull it back up later.
And there’s one more massive benefit to Repl.it: you can import any Python package ever because it supports all of them.
Trinket is another strong option. You get a lot of the same features as explored above: a passable code editor, the ability to run code, and the ability to share. But Trinket has two advantages. First, you can open multiple scripts with its tab-based interface, and second, you can embed Trinket into your own site if you have one.
Trinket’s free plan, while forever and unlimited, only allows basic Python 2.x. If you want full access to the Python 3.x version of Trinket, you’ll need to upgrade to the Connect plan, which costs $9 per month or $72 per year. “Full access” entails all built-in Python modules including Numpy, Matplotlib, SciPy, and more.
Ideone is a general purpose “try any programming language online” tool, so it isn’t as feature-packed or advanced as the other options above. Here’s what it does have: over 60 different programming languages and the option to label your code as Public, Secret, or Private.
Code written in Ideone is also subject to a few restrictions:
- Maximum 10 seconds to compile/interpret.
- Maximum 5 or 15 seconds while executing (for guests or registered users).
- Maximum 256 MB of RAM while executing.
- Access to the internet is blocked and new files can’t be created.
All in all, Ideone is an okay choice if you just need to test a bit of code right away, but for more serious explorations of Python, I would rather go with one of the others listed above.
Bonus: Python Tutor
Python Tutor isn’t an interactive Python shell, per se. Rather, once you type in your code, it will analyze what you wrote and present a visualization of the code logic. The result? A series of snapshots that you can walk through, one line of code at a time, to see how your code actually executes from start to finish.
This is a tremendous tool for programming beginners! You’ll see how each line of code affects different variables and outputs, making it easier for you to catch bugs and other issues. While programming can be tough for first timers, this tool can simplify the learning curve and help you wrap your head around the logic of it all.
You might also notice that Python Tutor has an experimental Live Programming mode. It’s similar to the regular visualization tool but analyzed and updates in real-time as you type. As of this writing, it’s both primitive and buggy so you should ignore it until all the kinks are ironed out.
Tips for Continuing Your Python Journey
After trying Python in an online interactive shell, you may decide that you love the language and want to pursue it on a more practical level. For that, you may fare well with these excellent online Python courses , or if you can’t spare any cash, these sites for learning Python .
Python may be one of the easiest languages to learn, but don’t be discouraged if you find it difficult. Coding in Python is still coding, and coding is tough. Struggling doesn’t mean that you should quit programming ! For a bit of extra motivation, I recommend listening to some of these helpful podcasts for programmers .
How do you like Python? Are there any other good interactive shells that we missed? If you have any other Python tips, especially for newbies, please share with us below!