How To Integrate Perl, Ruby, and Python Programs

Problem scenario
You want a Perl program to call a Python program to call a Ruby program to call another Python program.  You are using Linux as the OS.

Solution
Here is a one-line Perl program (course.pl) that calls a Python program:

system( “python /home/ec2-user/cont.py”);

Here is a two-line Python program named cont.py.  It invokes a Ruby program.

import subprocess
subprocess.call([‘ruby /home/ec2-user/integration.rb’],

How To Install Pip On Red Hat version 6 with Python 2.7.x Installed

Goal:  You want to install pip on RedHat 6 with Python version 2.7.x installed.
Problem scenario:  
You try “yum install python-pip” but get an error about python(abi) = 2.6 being an unmet dependency.  Trying to install an older version may require you to downgrade other components.  The latest version of Python packages is often safer and recommended. 
Solution:  Obtain a copy of 

Using Python and Ruby To Read Files

Problem:  You have a Python program that reads in a file named coolFile (in /tmp), and outputs the content to the screen.  The program prints an extra blank line after each line of content of the file named coolFile.  You want the output to not have an extra blank line.  Here is the code:

#/usr/bin/python

x = open(“/tmp/coolFile”, “r”)
for line in x:
        print (line)

How do you have the output now print an extra blank line after each line?

Ansible Managing Windows Servers

While as of right now, there is not a great way to install Ansible on Windows servers (because you have to install cygwin).  Ansible running on Linux can readily configure Windows servers and push files down to them.  There are some things to look out for when setting this up.  It is not overly documented on Ansible’s website.  Some documentation (on various websites) tells DevOps engineers (or the professional using Ansible) to use a windows.yml file in a group_vars directory. 

Python Documentation Issue

Python is a great language. 

On 11/10/15 we found an error on this Python documentation site.  Here is what we saw for the endswith function documentation:

The Syntax for the “endswith” function, on the face of the documentation, involves “startswith”.  We updated the site by clicking the “Edit on GitHub” link.  We corrected it on 11/10/15.  Hopefully someone will approve this change and the canonical syntax in the documentation will be corrected.