Security teams play a challenging and ever-changing role. Here's how a SOC can keep up

If Python is your jam, you may be looking for a solid IDE to use. Look no further than IDLE.

Image: SARINYAPINNGAM, Getty Images / iStockphoto

If you are a Python programmer, you are likely to do a lot of your work for the Linux environment. That is why you have many tools to make your daily grind less grindy and more productive. Such a tool is the IDLE Python IDE.

IDLE stands for Integrated Development Environment and contains functions such as:

The integrated IDLE debugger includes steps, persistent break points and visibility of the call stack. IDLE is also cross-platform and is available for Linux, macOS and Windows.

There are no shortage of functions with IDLE. This IDE is both open source and free. I want to show you how easy it is to install on Ubuntu Desktop 19.10.

SEE: Cheatsheet for telephone interviews: software developer (TechRepublic Premium)

What you need

The only things you need to make this work are:

  • An active copy of Ubuntu Desktop 19.10 (although this installation works on the most recent releases, as well as on Ubuntu derivatives)

  • A user account with sudo rights

How to update / upgrade Ubuntu

Before you install, it is always smart to perform an update / upgrade on the system. Note: If the kernel is updated during the process, you want to restart the system for the new kernel to take effect.

To update / upgrade Ubuntu, log in to the desktop, open a terminal window and give the following commands:

sudo apt-get update
sudo apt-get upgrade -y

After the upgrade is complete, restart if necessary. If you restart, log in again and you are ready to install.

How to install IDLE

The installation of IDLE is incredibly easy. Open a terminal window again and give the following command:

sudo apt-get install idle -y

That’s all there is to the IDLE installation. After the installation is complete, IDLE is ready to work.

How to use IDLE

If you click on your desktop menu, you will find two entries for IDLE. One has the IDLE label (using Python 3.75) and the other simply IDLE. If you are developing with Python version 3.7.5-1 or newer, open IDLE (with Python 3.75). If you are developing with an older version of Python, make sure you use the version that is simply called “IDLE”.

When the IDLE window is opened (Figure A), you are ready to start coding.

Figure A

The IDLE window, ready for action.

Type the line at the IDLE prompt:

print (“Hello, TechRepublic”)

Press Enter on your keyboard and you should see the results (Figure B).

Figure B

Easy is not it? Let’s create a new file with code that checks whether a year is a leap year. To do this, open IDLE and then click File | New. Paste the following code in the following window:

year = int (input (“Enter a year:”))

if (year% 4) == 0:
if (year% 100) == 0:
if (year% 400) == 0:
print (“{0} is a leap year” .format (year))
different:
print (“{0} is not a leap year” .format (year))
different:
print (“{0} is a leap year” .format (year))
different:
print (“{0} is not a leap year” .format (year))

Then click on File | Save and give the program a name (such as year.py). After the file has been saved, click Run | Run module. A new window will open asking you to enter a year (Figure C).

Figure C

The run module in action.

With this small Python program you will be asked to enter a year and it will then calculate whether that year is a leap year. Because I saw what the first day of 2020 is (and it is a leap year), I thought this was apropos.

And so you install and use the IDLE Python IDE in Ubuntu Desktop. Read the official documentation for more information on how to get the most out of this integrated development environment.

Open source weekly newsletter

You do not want to miss our tips, tutorials and comments about the Linux operating system and open source applications.
Delivered Tuesday

Register today

Also see

Similar Posts

Leave a Reply