DEV Community

Cover image for 5 Tools to Start Working with Python 🤯☢️😱
sc0v0ne
sc0v0ne

Posted on • Edited on

5 Tools to Start Working with Python 🤯☢️😱

This tutorial will show where to start developing with python, but it won’t show what your types are, what are frameworks, none of that. I want to show development tools to use with python, to develop scripts or even notebooks that we will see later. I apologize if you do not have an explanation for Windows operating system, I am family with Linux operating systems, following content will be turned to Linux, but has python environments that are not used locally like Google Colab and Kaggle, access is found by the browser. But I won’t leave you empty hands to Python content. I will leave the links below content that I had the pleasure of watching or reading and that sized me as a professional.

Let’s start 😎

Terminal

Created by the author

The terror of many users, but the terminal and equal to programming language, after learning it is easier. Majorians of Linux Operating Systems, already bring the Python installed. Observe the image below, open your terminal, type Python3-Version.

Created by the author

If you return Python 3. {some number, [10.6, 8.2, 11.2]}, great you have the python installed on your machine.

If you don’t have it follows the documentation link for installation

To start writing codes in python, just type python3.

Created by the author

Note that the terminal symbol has changed, it shows that we are inside Python Shell or Python Iterative Terminal. Where we can insert some writing in python and start development. Without further explanation, let’s give a hey python !!!.

My point of view as a developer to use Python Terminal:

Say that you will program codes and codes directly at the terminal, I would be lying. It comes to a point that you need various tools to meet different points that software, test and other things. But if you are starting it will be your best friend, without distractions and you and the terminal.

Even though it is a developer with a few years of experience. I still use the terminal with python. Not for codes in production. But there are moments that you test a small piece of code. It turns out that when software already has a maturity. Put to run, it can take a while. Using the terminal you already check an idea of something, check the output. If you agree, you reuse in the code. This helps a lot with development and time.

Jupyter Notebook

Our Jupyter Notebook looks like yesterday I fell in love with this tool, I met in college. I use it to this day. Definition for this tool and simplicity and power.

For this tool and the following of this article you should already have Python installed on your machine.

Following the steps:

Have the python installed on your machine

Create a separated python environment from the main one.

“I started with Python today what you’re talking about?”

The python you have installed on the machine works globally, what do you mean? If you have an app on the machine as a disad, let’s say it has the need to use some Python functionality to run message. When it is running, you will perform a search inside your machine to use Python. This would be an example globally. This was the way to create a context. When we create an environment separates from Python Global, Python Isolomes in a new space containing Python language.

But you read it, but why should you do that?

Let’s go back to the global context, you are developing two Python, Project_A and Project_B projects, each project uses the same Python Library called Python_Coffee. But you want to update the library that is in the project_a for version 2.0. When you update the library that is globally on your machine, you will update for all projects include the_b project, but we have a problem with it, because the project_b has the need for Python_Coffee library to be in version 1.0 because it is using some functions of this version. As you have updated to version 2.0 can generate library incompatibility and functions in the_b project. That’s why we need to create python environments for different projects and not have this kind of problem. Note the example below how to do it.

Created by the author

  • Terminal
  • Enter the command -> cd ~
  • After -> ls.
  • Enter the downloads folder -> cd Downloads
  • Let’s create a folder -> mkdir medium_example
  • Let’s get in the folder -> cd medium_example
  • Enter the command -> ls. To check if it is empty.

You can create in any directory you want, these acimas were just for example.

Let’s now prepare a separate Python environment from the global.

Created by the author

This command is used to create a venv. venvor env will be your Python environment isolated from the global.

python3 -m venv venv
Enter fullscreen mode Exit fullscreen mode

Activate your venv

source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

Install Library notebook

pip3 install notebook
Enter fullscreen mode Exit fullscreen mode

Start a session at jupyter notebook:

This command is intended to start the jupyter notebook

jupyter notebook
Enter fullscreen mode Exit fullscreen mode

Created by the author

Soon after you will be directed to a new place.

Created by the author

How do you set everything up in an isolated environment. Our run will be created from the directory. In which it was chosen for development.

In this same image there is a “new” option, when clicking there will appear some options more we want and the Python 3 file.

Created by the author

After clicking on Python 3, it will be redirected to one on the tab. Being a new notebook.

Created by the author

Apart from here you can start your Python development.

Benefits

  • Control: You can create python environments, with different libraries of your choice without overloading without knowing what is installed. I just added the tools that need.

  • Version: From the moment you created a repository at Gitlab or Github and have your project locally. Being able to create various versions of your notebooks, saving Requests, Markdown files for notes and more. Beyond if it can publicly share your notebook.

  • Speed: In particular I have a taste in using notebooks on my computer than having them in the cloud like Google Colab notebooks that I will talk further. The executions are faster and if you want to stop execution I can do this efficiently, using the cloud has a tendency to have to stop.

Devatanges

  • Preparing Environment: Using Locally Locally You will always have to prepare an environment, of course you can create a container to make it easier or other way. But it will have the same commitment to prepare the environment.

  • High processing: If you have a very large set, you need to train to create a model as an example. Your computer may not stop processing because it does not support so much load.

Google Colab

Using Google Colab you can develop Python codes, similar to Jupyter Notebooks. You will have an environment prepared with various Python libraries. In addition you have tips on small codes for development, some tutorials, gihub connection, cloud -saved notebooks and more.

For starters you will basically need a Google account to connect to the environment.

Then click “New notebook”.

Created by the author

Note that it follows the same structure as the Jupyter Notebook. From here you can start.

Created by the author

This here is an example for you to see how you have libraries available.

Created by the author

Benefits

  • Cloud: Something that is very useful and having an Auto Save where you only need to develop and when finished will be saved to your Google Drive account.

  • Without the need for environment: You won’t need to prepare any configuration that has no need for your development. Of course you can have an unavailable library, but just add to the cell! Pip install and then you can use it.

  • GPU: This simply amazing advantage, you can process large data sets. For models of machine learning or Deep Learning. Using GPU (Graphics Processing Unit), which your computer does not support, the GPU may support within its limit.

Devatanges

  • Connection: In development you can have loss of connection or auto save. This observed from experience by performing some models of ML. Another connection point even being on your Google account, if you need to use a set that is on your Google Drive, you will be requested to connect. This is bad, because if you are working with more than 2 notebooks you will be asking every time you start the 0 executions.

  • Hard to prepare an environment: Because of that, I don’t know about you as developers but I like to be in control. This is Google Colab, not much allows you to use Python Experific versions, older library versions, and can generate incompatibility.

VS Code IDE

VS Code no doubt and my favorite. With him we can work with Python, Rust, Go various languages. We have integrated terminal, extensions, code debugger. Simply a Swiss Plankeet of Options.

Note that when using vs Code we can work with notebook too and scripts python.

Created by the author

Created by the author

Here the advantages and disadvantages will be very similar to Jupyter Notebook.

Benefits

  • Control: You can create python environments, with different libraries of your choice without overloading without knowing what is installed. I just added the tools that need.

  • Version: From the moment you created a repository at Gitlab or Github and have your project locally. Being able to create various versions of your notebooks, saving Requests, Markdown files for notes and more. Beyond if it can publicly share your notebook.

  • Speed: The executions are faster and if you want to stop execution I can do this efficiently.

Devatanges

  • Preparing Environment: Using Locally Locally You will always have to prepare an environment, of course you can create a container to make it easier or other way. But it will have the same commitment to prepare the environment.

  • High processing: If you have a very large set, you need to train to create a model as an example. Your computer may not stop processing because it does not support so much load.

Kaggle

The Kaggle platform undoubtedly and the most complete. You have competitions, notebooks, data sets, discussions, models and mini courses. I like the platform more because it works for different levels of troops. If you are starting, you can confirm the mini-courses with different topics. If you already have experience you can test public notebooks, create new and test in data sets. In addition to all available for all, they are the competitions where you can challenge yourself to develop something surprinant.

Created by the author

Benefits

  • Cloud: Something that is very useful and having an Auto Save where you only need to develop and when finished will be saved to your Kaggle account.

  • Without the need for environment: You won’t need to prepare any configuration that has no need for your development. Of course you can have an unavailable library, but just add to the cell! Pip install and then you can use it.

  • GPU: This simply amazing advantage, you can process large data sets. For models of machine learning or Deep Learning. Using GPU (Graphics Processing Unit), which your computer does not support, the GPU may support within its limit.

  • Data sets: You will not need to download anything anywhere if you do not need. Within the development notebook you got it imports data sets that are available.

Devatanges

  • Hard to prepare an environment: Because of that, I don’t know about you as developers but I like to be in control. This Kaggle does not allow you to use Python expected versions, older library versions, and can generate incompatibility.

  • Integration: This disadvantage I see and a little of the integration with Github, I find it a little limited just being available this option. Where it has Gitlab and others too. Also not every time it will be version control with Github integration and lost. The control is only on the platform.

Comments:

Thanks for reading this far. I hope I can help you understand. Any code or text errors please do not hesitate to return. Don’t forget to leave a like so you can reach more people.

About the author:

A little more about me...

Graduated in Bachelor of Information Systems, in college I had contact with different technologies. Along the way, I took the Artificial Intelligence course, where I had my first contact with machine learning and Python. From this it became my passion to learn about this area. Today I work with machine learning and deep learning developing communication software. Along the way, I created a blog where I create some posts about subjects that I am studying and share them to help other users.

I'm currently learning TensorFlow and Computer Vision

Curiosity: I love coffee

Top comments (0)