Regular Python code directly in the GHPython component (whithout remote)

Hi,
I don;t know if this is possible, but it will make everything a lot more clean and straightforward.
There are millions of libraries out there to play with.
Thanks

it is theoretically possible.

What is “regular python code”? I’m going to need to better understand what you are referring to before I can answer.

CPython3 I assume

Hello Bogdan,

According to the answers to this thread there are no current plans to incorporate CPython in Rhino / GrassHopper, though you can apparently use Rhino Inside to go the other way, calling some Rhino 7 WIP functionality from CPython. If you are looking for specific functionality then people may be able to suggest a workaround.

Best regards,

Graham

There are no current plans to switch to a CPython based interpreter. CPython may have access to a lot of libraries, but when running inside of Grasshopper we really need access to RhinoCommon and Grasshopper SDKs which are .NET based. There is a library called Pythonnet (https://github.com/pythonnet/pythonnet) that helps to bridge communication between CPython and .NET, but I am still seeing problems with the use of this library for internal Rhino/Grasshopper purposes. Maybe this will change with time.

Pythonnet are desperately looking for finance and support or they will suspend the project.
Just FYI.

(Companies like Unity have declared interest)
Perhaps McNeel could get involved and shape pythonnet to fit Rhino needs and integrate it somehow.

I do like IronPython though. :wink:
Too many things are dependent on numpy/scipy nowadays, instead of thinking of developing algorithms people are getting lazy :stuck_out_tongue_winking_eye:

Yes lazy people like CERN, NASA, PayPal and others are just using numpy and scipy and building their own amazing work on top, instead of spending their time reimplementing and testing vector maths, fourrier analysis, etc over and over again :wink:

Unusually for open source they have received millions of dollars in support, on top of a vast volunteer network, presumably because so much of the worlds scientific research and financial systems depend upon them now…

Rhino users will also be able to benefit from all that work once we figure out a good integration path…

I wish I could play with this. Unfortunately we’re on Rhino 5 at work so I have no access to the WIP :frowning:

good for them, they don’t want to re-invent the wheel, like me.

Do you really think even over 50% of them understand what’s behind the tools they use? It’s probably a handful of people that do.

True. The advantage of highly readable open source software is that you can look into it and try to understand the bits you need if you wish.

Not only that, when I was studying in the university no one cared to include “numerical methods” discipline. I took one semester MATLAB which was total bullshit. Years after I decided to learn programming and I’m stuck because I can’t really learn when most Numerical Methods books show how things are done only with numpy. (at least python targeting books that I’ve found).

Yes CPython is so dominant compared to Jython, Ironpython, et al, and Cython and PyPy are numpy compatible so that you’re unlikely to find many Python resources focussing on other implementations… and I don’t think .Net is a popular choice for sciencey work… it was more FORTRAN, C, Matlab and now R and CPython, I think. Matlab is the opposite of open source so…