Python Installation

This topic is to discuss the following lesson:

Hi Rene,

Today, I was discussing with the network administrator of my company about thenetwork programmability and Devops.

He told me that Ansible will replace python for network automation, because it is more easier to learn and code for a lot of network engenieers.

What do you think about that?

Thanks as always

Hello Giovanni

It is important to understand the role and the functionality of both Ansible and Python in order to determine which is best to use, and in which situations.

Ansible and Python are not direct equivalents, and cannot be directly compared. Ansible is a tool that is written in Python, and you don’t need to know any Python to use it. But, if you do know Python, then it is easy to extend the capabilities and functionalities of Ansible. As such, Ansible relies on Python to function.

Ansible is easier to use, and easier to learn, as you correctly stated. It is probably a more accessible tool for network engineers that want to automate simpler functions such as configuration changes, repetitive tasks, and identical tasks that have to be implemented on multiple devices.

Python on the other hand has a steeper learning curve, is not as easily understood, and requires more time to comprehend and to use effectively within a network. BUT, ultimately, Python is more powerful, flexible, and gives you complete control on performing very specific tasks.

So which is better and which will replace which? I don’t think there’s an answer to that… I think that each one will be used for its particular strengths. In general however, if you want to get stared with network automation, and you have no knowledge of Python, or Ansible, then start with Ansible.

If you have complex and obscure tasks and you need a highly customized automation solution, then you should go with Python.

They’re not mutually exclusive, so you can use each one according to your needs, your time, your coding expertise level, and the actual task to be performed.

I hope this has been helpful!

Laz

2 Likes

Thank you :slight_smile:

Hi Laz,

“Add Python 3.x to PATH” checkbox. This means you can run Python anywhere from the command line, not just from the folder where it is installed" , here i don’t get "you can run anywhere’’ mean at any computer in a n/w from single computer if it is installed on each and every computer?

Hello Pradyumna

This simply means that you can run it from any PATH in the command prompt. If the checkbox is not checked, then you must be in the same folder as the python installation files.

For example, if you don’t check the box, then you must be in the following folder in the CLI in order to run python:

image

If you check the box, then you can run from any location in the CLI such as:

C:\Users\user

or even

C:\

image

I hope this has been helpful!

Laz

1 Like

Thanks Laz understood.

Hi guys.

Do you know how can I use IIS or apache for my python scripts, do you have any tutorial about that?

I’m tryng to print hello world using IIS but I have autorization issues.

I followed these steps:

  • Enebled CGI
  • Added an application on the default web site
    *Added a script Map for *.py
    *gived an execution permission to work

But it still not work ( unathorized )
:frowning: mabye I need some tutorial to do so…even in linux if is possible.

Thank you


EDITED


Ok,
I solved my problem.

My task was to execute python scripts from web using IIS.

I follow this step to configure the server.

After that I’ve modified the Authentication using application pool identities and assigned the default application pool to “LocalSystem” identity to solve my permission problem.

I hope that my headache can be helpful to someone :slight_smile:

1 Like

Hey Giovanni

Thanks for sharing your solution! It is much appreciated by us, and by all the users that will use this info for their benefit…

Thanks again!

Laz

1 Like