How to extract a zip archive with Python on Windows

Have you ever been asked or wonder how to learning a programming language? If not, then you can skip this blog post. :-) At work, a coworker said to me “I want to learn a programming language. Where do I start or how do I even start it?” I was asked this question because I had explicitly expressed my interest to my teams that I like programming a lot, though programming is not being used my professional career at the moment....

September 26, 2023 · 3 min · 466 words · kenno

Install Ansible on Freebsd

This post briefly explains how to install Ansible on a FreeBSD host. I’m going to install Ansible in a virtual environment using Python 3. (If you still use Python 2, it’s time to start migrating to Python 3 now.) $ sudo pkg install python36 $ mkdir ~/dev/python3-venv $ python3 -m venv ~/dev/python3-venv/ansible Next, activate the Python venv (ansible), and start installing Ansible using pip: $ source ~/dev/python3-venv/ansible $ pip install ansible You may or may not need to update pip module as I did....

February 21, 2019 · 1 min · 138 words · kenno

Installing Pip with Python 3.5 on FreeBSD

Here is a quick note serves as a self-reminder on how to get pip working or installed on FreeBSD 10.3. First, ensure that Python 3 package is installed. Python 3 is provided by python35 package. # pkg install python35 However, there is no package for pip, at least at the time of this writing, on FreeBSD. To have it installed, run the following command: # python3.5 -m ensurepip We should as well update pip to new version:...

May 6, 2016 · 1 min · 84 words · kenno

Python: How to convert a list to a string

There must already exist a gazillion articles about how to do this; but one more won’t hurt, right? Suppose you have a list, called alist, as the following: In [2]: alist Out[2]: ['apple', 'banana', 'pear'] To create a string from “alist” with a comma separator, we can do this: In [3]: ','.join(alist) Out[3]: 'apple,banana,pear' Basically, you can place a desired separator in the ',' or omit it totally. Reference:

August 2, 2014 · 1 min · 70 words · kenno

Install Python 3 on CentOS 6

The latest release of Python 3 is 3.3.2, and there’s no package available on CentOS repo via yum. The following steps explains how to manually get Python 3 onto a CentOS system: Install development tools # yum groupinstall "Development Tools" # yum install zlib-devel bzip2-devel openssl-devel \ ncurses-devel sqlite-devel readline-devel tk-devel Download and install Python $ wget $ tar xjf Python-3.3.2.tar.bz2 $ cd Python-3.3.2 $ ./configure --prefix=/opt/python3 $ make $ make install</pre> Test...

September 4, 2013 · 1 min · 81 words · kenno