<p>I'm using pycoin (<a href="https://github.com/richardkiss/pycoin" rel="nofollow">https://github.com/richardkiss/pycoin</a>) 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.</p>

<ul>
<li>Python is good because it's easy to get projects up and running quickly. </li>
<li>There are libraries that take the work out of things like ECDSA.</li>
<li>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. </li>
</ul>

<p>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.</p>

CC BY-SA 3.0
2014-10-29T01:35:02.097Z
2014-10-29T01:35:02.097Z
morsecoder
<p>In comparison to languages like Java or C++, Python has several advantages for coding bitcoin projects:</p>

<ul>
<li>Simplified rules of coding allows beginners and experienced alike to code and get results without getting bogged down in formatting etc</li>
<li>Shell allows <em>on the fly</em> calculations</li>
<li>Python code is easily read and as such can be edited to suit</li>
<li>Python can be compiled into an executable or run uncompiled</li>
</ul>

<p>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. </p>

<p>The caveat of course is that most Bitcoin Python utilities (Pybitcointools, Pycoin, <a href="http://libbitcoin.dyne.org" rel="nofollow">sx/libitcoin</a> require Python version 2, whereas Python 3 is the current release and, mind-bogglingly, <strong>3.x is not backwards compatible with Python 2</strong></p>

<p>If you want to get a feel for what Python can offer check out either:</p>

<ul>
<li><a href="http://blog.richardkiss.com/?p=371" rel="nofollow">RICHARD KISS</a> blog</li>
<li>RICHARD KISS <a href="http://youtu.be/4ufTcteXVNk" rel="nofollow">YouTube class</a> </li>
<li><a href="http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html" rel="nofollow">KEN SHERIFF</a> blog</li>
</ul>

CC BY-SA 3.0
2014-10-29T12:22:28.830Z
I think a lot of projects are moving toward Python 3 compatibility ATM, even if not there yet.
Mikko Ohtamaa
CC BY-SA 3.0
2014-10-30T00:49:44.473Z
@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 Ozzie
CC BY-SA 3.0
2014-10-30T11:04:53.010Z
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 Ohtamaa
CC BY-SA 3.0
2014-10-29T08:26:11.033Z
2014-10-30T00:47:03.430Z
2014-10-30T00:47:03.430Z
Wizard Of Ozzie
<p>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.</p>

<p>On <a href="https://github.com/search?utf8=%E2%9C%93&amp;q=bitcoin">this Github search result</a>, you can see that Python is ranked second when you search the keyword 'bitcoin'.</p>

CC BY-SA 3.0
2014-10-29T12:23:20.473Z
It's not limited to Bitcoin, but Python is generally popular in financial technology projects due to reasons mentioned in the answers.
Mikko Ohtamaa
CC BY-SA 3.0
2014-10-30T01:23:03.333Z
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 Ozzie
CC BY-SA 3.0
2015-02-06T10:12:30.403Z
There is now Python framework for developing cryptoasset applications: https://bitbucket.org/miohtama/cryptoassets (disclaimer: I am one of authors)
Mikko Ohtamaa
<development><python>
Why is Python popular in Bitcoin projects?
mc9
# Why is Python popular in Bitcoin projects?

(Asked by: username_0 on 2014-10-29)

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.

On [this Github search result](https://github.com/search?utf8=%E2%9C%93&q=bitcoin), you can see that Python is ranked second when you search the keyword 'bitcoin'.

**Tags:** development, python

> **Comments:**
> **username_1**: It's not limited to Bitcoin, but Python is generally popular in financial technology projects due to reasons mentioned in the answers.  
> **username_2**: 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)  
> **username_1**: There is now Python framework for developing cryptoasset applications: https://bitbucket.org/miohtama/cryptoassets (disclaimer: I am one of authors)  

---

## 2 answers

### Answer by username_2 on 2014-10-29. Score: 8 | Accepted answer

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](http://libbitcoin.dyne.org) require Python version 2, whereas Python 3 is the current release and, mind-bogglingly, **3.x is not backwards compatible with Python 2**

If you want to get a feel for what Python can offer check out either:

* [RICHARD KISS](http://blog.richardkiss.com/?p=371) blog
* RICHARD KISS [YouTube class](http://youtu.be/4ufTcteXVNk)
* [KEN SHERIFF](http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html) blog

> **Comments:**
> **username_1**: I think a lot of projects are moving toward Python 3 compatibility ATM, even if not there yet.  
> **username_2**: @username_1 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"  
> **username_1**: 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.  

---

### Answer by username_3 on 2014-10-29. Score: 3

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.


---

