When checking out open source projects related to Bitcoin, I see that many are written in, or make a large use of, Python language. I mostly use Ruby and have little experience in Python; so, I would like to know why this is the case.

It's not limited to Bitcoin, but Python is generally popular in financial technology projects due to reasons mentioned in the answers.
– Mikko OhtamaaOct 29 '14 at 12:23

I'll have to get a rundown on Ruby to let you know why Python is better but follow along with Richard Kiss' blog post in my answer to see how great Python is (use Python v 2.7)
– Wizard Of OzzieOct 30 '14 at 1:23

2 Answers
2

In comparison to languages like Java or C++, Python has several advantages for coding bitcoin projects:

Simplified rules of coding allows beginners and experienced alike to code and get results without getting bogged down in formatting etc

Shell allows on the fly calculations

Python code is easily read and as such can be edited to suit

Python can be compiled into an executable or run uncompiled

I suppose in essence, Python is great for small scripts/applications and these small applications often align with difficult Bitcoin protocol mechanisms which are greatly simplified.

The caveat of course is that most Bitcoin Python utilities (Pybitcointools, Pycoin, sx/libitcoin require Python version 2, whereas Python 3 is the current release and, mind-bogglingly, 3.x is not backwards compatible with Python 2

I think a lot of projects are moving toward Python 3 compatibility ATM, even if not there yet.
– Mikko OhtamaaOct 29 '14 at 12:22

@MikkoOhtamaa yes, you're right. It just blew me away when I asked the question "why won't my Python 2 work in Python 3?" and the answer was a well accepted "no back comptability"
– Wizard Of OzzieOct 30 '14 at 0:49

You can write Python which is directly compatible with Python 2 and Python 3. But most people didn't. Now the world is slowly transition to the phase the libraries run on both.
– Mikko OhtamaaOct 30 '14 at 11:04

I'm using pycoin (https://github.com/richardkiss/pycoin) in a project right now actually, tring to verify the data that needs to be signed in a bitcoin transaction, so I think I can speak to this.

Python is good because it's easy to get projects up and running quickly.

There are libraries that take the work out of things like ECDSA.

Python is a more accessible language than trying to code in C++, with all those pointers and references, not to mention compiling. Running on an interpreted language like python has the advantage here.

The disadvantage, however, is that python will not be scalable enough for all applications. There's a reason why the Core client, for example, wasn't written in python.