# Difference between GhPython and GH\_CPython

**URL:** <https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149>\
**Category:** Grasshopper\
**Created:** [September 2, 2017, 5:28am UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149 "2017-09-02T05:28:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Zeng](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jack_zeng/32/761863_2.png) [@Jack\_Zeng](https://discourse.mcneel.com/u/Jack_Zeng)\
**Post date:** [September 2, 2017, 5:28am UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/1 "2017-09-02T05:28:44Z")

</div>

Dear all,  
I am recently using GhPython and I found that now we have a new plug-in call “GH\_CPython”. Did anyone have use both and know the different or pro & con of these two plug-ins?  
Thanks,  
Jack

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 2, 2017, 6:43am UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/2 "2017-09-02T06:43:49Z")

</div>

There are different flavors of Python; GH\_Python uses `IronPython` which is coupled to the .NET framework. The interface to .NET enables the use of the `RhinoCommon` library which allows you to use and modify geometry objects with Python code in the Grasshopper definition. But because of this dependency to the .NET framework, it is not possible to use Python libraries that have python-native (C++) dependencies, like the popular `numpy` library and others.

It looks like GH\_CPython now provides an interface to these python-native libraries: the screenshots on Food4Rhino show the use of `numpy`. It does not, however, allow you to modify geometry objects in Grasshopper as far as I can see.

---

<div class="post-metadata">

**Author:** ![Jack\_Zeng](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jack_zeng/32/761863_2.png) [@Jack\_Zeng](https://discourse.mcneel.com/u/Jack_Zeng)\
**Post date:** [September 2, 2017, 1:30pm UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/3 "2017-09-02T13:30:40Z")

</div>

Hi Menno,  
I see…So GH\_CPython can only deal with abstract data like number, string etc. but not geometries.  
Thanks,  
Jack

---

<div class="post-metadata">

**Author:** ![Mahmoud\_Mohamed\_Ouf](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mahmoud_mohamed_ouf/32/66471_2.png) [@Mahmoud\_Mohamed\_Ouf](https://discourse.mcneel.com/u/Mahmoud_Mohamed_Ouf)\
**Post date:** [September 3, 2017, 3:38pm UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/4 "2017-09-03T15:38:52Z")

</div>

Hi Jack,  
Thanks so much for this subject…

* * *

Hi menno,  
Thanks so much for explaining the differences between GhPython and GH\_CPython,  
GH\_CPython still in the development process, one of its main advantages, is that you can use any scientific library such as Numpy, Scipy and matplotlib and so on… In addition, it works properly with any version of Python e.g. 2.7, 3.4, 3.5, or 3.6 … and can benefit from all of Python advantages including its efficiency.

As manno has said, It still doesn’t have `RhinoCommon` library, I’m still working on adding `RhinoScriptSyntax` to it. It will take some time, but I’m working hard on it and I expect it to be available in the Beta version.

I think that you can benefit from `.NET` framework by installing [PythonNet](https://github.com/pythonnet/pythonnet) library,

At the present version, I have tried communicating with Rhino using a module called `Grasshopper` but some fellows suggested that I include `RhinoScriptSyntax` as it will be easier and more familiar to developers. I’m working hard on solving this problem and I’ll try to release it as soon as possible it will take  
a lot of effort, and I appreciate any contribution in developing this tool in order to be integrated with GhPython and to be useful to computational designers world wide:

 ![image](https://user-images.githubusercontent.com/6969514/30004276-7e8fd47c-90cc-11e7-9251-5eafbcc74b5c.png)

Your feedback are most welcome and I appreciate it so much.

> **[MahmoudAbdelRahman/GH\_CPython](https://github.com/MahmoudAbdelRahman/GH_CPython)**
>
> CPython plugin for Rhino-Grasshopper. Contribute to MahmoudAbdelRahman/GH\_CPython development by creating an account on GitHub.

Sincere regards,  
Mahmoud Abdelrahman

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [September 4, 2017, 6:25am UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/5 "2017-09-04T06:25:39Z")

</div>

Maybe I’m wrong, but I believe that the RhinoScriptSyntax is built on top of RhinoCommon anyway.

---

<div class="post-metadata">

**Author:** ![Mahmoud\_Mohamed\_Ouf](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mahmoud_mohamed_ouf/32/66471_2.png) [@Mahmoud\_Mohamed\_Ouf](https://discourse.mcneel.com/u/Mahmoud_Mohamed_Ouf)\
**Post date:** [September 4, 2017, 8:27am UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/6 "2017-09-04T08:27:05Z")

</div>

Yes, you are right,  
I think it is impossible to access `RhinoCommon` from `CPython`, so I’ll just take the syntax of `RhinoScriptSyntax` and rewrite all the methods as possible. May be at the beginning, I’ll write only the basic methods `curves, points, vectors, surfaces, nurbs, textures ...`

---

<div class="post-metadata">

**Author:** ![Jack\_Zeng](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jack_zeng/32/761863_2.png) [@Jack\_Zeng](https://discourse.mcneel.com/u/Jack_Zeng)\
**Post date:** [September 5, 2017, 2:22am UTC](https://discourse.mcneel.com/t/difference-between-ghpython-and-gh-cpython/47149/7 "2017-09-05T02:22:35Z")

</div>

Dear Mahmoud,  
Thanks for the informative descriptions!  
And big thanks for your hard work on GH\_CPython, it is a huge progress to let python be able to access those scientific libraries and really looking forward to more geometric functionalities adding!!👍👍

Jack
