Category Archives: Python

By August 08, 2018

File \”/tmp/ansible_PzNRht/ansible_modlib.zip/ansible/module_utils/urls.py\”, line 340, in <module>\r\nAttributeError: ‘module’ object has no attribute ‘HTTPSHandler’\r\n”, “msg”: “MODULE FAILURE”, “r   This is due to Python being unable to import the ssl module. To see the actual error, you will need to log into the server and try to import ssl .   Python<version> import ssl File “/usr/local/lib/python2.7/ssl.py”, line


Read More
By August 08, 2018

Python error when trying to import ssl File “/usr/local/lib/python2.7/ssl.py”, line 60, in <module> import _ssl # if we can’t import it, let the error propagate ImportError: No module named _ssl   solution: You can rebuild python from the source or copy the library from another server. File location /usr/local/python27/lib/python2.7/lib-dynload/_ssl.so Once the file has been copied.


Read More
By December 16, 2017

Check out the code snippet below to see how it works to generate a number between 1 and 100. import random for x in range(10): print random.randint(1,101) The code above will print 10 random values of numbers between 1 and 100. The second line, for x in range(10), determines how many values will be printed


Read More
By September 24, 2017

Read More
By December 28, 2016

Apache / Python basic setup This is a from the ground up basic Apache/ Python integration. Linux OS: Debian 1. apt-get install python apache2 2. enable the cgi module by running ” a2enmod cgi ” 3. update the Apache config setting. For me I set AllowOverride to All because i wanted to set my configs


Read More
1 2