Learner Profiles

Ways of Working in Python


When it comes to get started with programming in Python, there are several ways to code. These include terminal-editor combination, IDEs (intergrated development environments) and notebooks. But it is really important to understand that Python itself is independent of any of these. Python acts as an engine at the back-end whereas terminal, IDE or notebooks are the front-end interfaces that makes us to interact with Python. We can use playstation and its controller as an analogy where Python is a playstation console and terminal, IDE or notebooks are different types of controllers and its the type of game (project) or user’s preference that determines which controller to use.

1. Editor/Terminal


The most conventional and classical coding method for beginners has been using a simple text editor (notepad) and terminal. These are essential elements of any operating system (Windows/Linux/Mac) and come bundled. Therefore they offer an easier, quicker and efficient solution to coding. It can easily be demonstrated that a simple program is not more than writing down instruction in a text file (shown in the image), saving it with python extension (.py) and executing on a terminal as:

python3 helloworld.py

In addition to a simple notepad editor (without any programming-related features), there are other advanced command line editors with syntax highlighting such as nano and vim that can be used to write the code on terminal and save it to a python (.py) file. This is particularly useful for quickly writing and testing a script without having to install any advanced editors. Starting coding using these built-in tools is advantageous for beginners as it saves them from installing heavy softwares (e.g; IDEs) and entire focus can remain on learning coding practices instead of learning plugin installations, code style checking, code suggestions and automatic error correction - offered by many IDEs.

Code Editor

In comparison to built-in text editors, there are other specialised code editors that require installation as an independent piece of software. A code editor is one of the most crucial tools for programmers solely designed for coding. It is basically a text editor with more functionalities, built-in features and more advanced tools that help to colour the code and make coding easier. These additional features simplify and accelerate the process of editing and help to write better software programs by identifying problem areas and debugging code. Most of the code editors have integrated terminal for running the code. For any beginner who is learning to code in any language should use a code editor. The most popular and widely used code editors are Visual Studio Code and sublime.

Why use Visual Studio Code?

In order to code in Python, we highly recommend using a code editor, Visual Studio Code with the installation of Python extension. Visual Studio Code is “a free-editor that helps the programmer write code, helps in debugging and corrects the code using the intelli-sense method”. It has some very unique features. These include:

  • Support for multiple programming languages: In past, programmers needed a different editor for different languages, but visual studio code has built-in multi-language support.
  • Intelli-Sense: Any incomplete code can be detected and corrected
  • Cross-Platform Support: It can work on Windows, Linux or Mac systems which make it the strongest cross-platform editor.
  • Terminal Support: It has an in-built terminal or console and saves user to switch in-between two screens.
  • Extensions and Support: It supports alomost all the programming languages but, if the user/programmer wants to use the programming language which is not supported then, he can download the extension and use it. And performance-wise, the extension doesn’t slow down the editor as it rums as a different process.
  • Repository/Git Support: It is connected with Git or can be connected with any other repository for pulling or saving the instances.
  • Multi-Projects: Multiple projects containing multiple files/folders can be opened simultaneously. These projects/folders might or might not be related to each other.
  • Commenting: A common feature, but some of the languages do not support it. Commenting on the code helps the user to recall or track according to the sequence he wants.

2. IDEs


Generally, IDEs or integrated development environments are robust softwares development tools that make programming experience easier by combining text editors with other useful functions such as formatting, liniting, code refactoring and debugging. At the same time, having all these features in a single tool makes them heavy and slow, consequently taking more disk space, memory and long startup time. Most common IDEs are Visual Studio, Xcode, Netbeans and Eclipse and can be used for Python development. They are ideal for software development process but not for simple scripting.

In recent years, IDEs are particularly developed for python programming to facilitate writing and running scripts. Some of the most commonly used python IDEs are Spyder, PyCharm, ATOM, PyDev, Eric and python IDLE.

3. Notebooks


Python notebooks provide an open-source web based platform to write and execute interactive code that can be shared as a document containing live code, outputs, visualizations and descriptive text. The widely used python notebooks include jupyter notebook, google colab, and VScode notebooks. JupyterLab provides a web-based interactive development environment for Jupyter notebooks, code, and data.

Notebooks are not usually used for development and scripting but are mostly used for data cleaning and transformation, visualization, statistical analysis, machine learning and data science. They are ideal for testing small snippets of code.

Why Anaconda?


Anaconda is a distribution of the Python and R programming languages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.), that aims to simplify package management and deployment. The distribution includes data-science packages suitable for Windows, Linux, and macOS. Installation of Anaconda distribution on any machine let you use Spyder (python IDE), jupyter Lab, jupyter notebook and visual studio code without having to install them seperately.

Managing different Environments in Anaconda