Python advice


(Willem Derks) #1

Hi community,

I’d like some advice and insight about working with python outside Rhino.

For a upcoming project; I’m going to have Grasshopper/Rhino interact with a hardware setup in realtime, as there are many options already available to input and output data out of Grasshopper. At this moment I suspect we will be streaming data out via UDP.

However, I expect there will be quite some python scripts that can/should run outside of Rhino as it has nothing to do with the 3D model interaction. (Mainly primary setup of the system via image processing and the resulting static 3D model). I can even imagine that after the first prototypes we can create the 3D environment via python thus abandoning Rhino/Grasshopper altogether.

What I would like advice about is what version of python I should work with. For compatibility I want to run python 2.7.7. But should I choose IronPython as that is what Rhino uses, or will regular Python do just fine without much compatibility issues? Is 64b a good option are should we stick with 32b?

This is all uncharted territory for us so any advice or guidelines are welcome.

Thanks
-Willem


(Nathan 'jesterKing' Letwory) #2

If you don’t have dependencies on Rhino nor Grasshopper I’d use vanilla Python 2.7 (or why not even Python 3.x). 64bit is a good choice if you expect large data sets.

You also might want to look into NumPy/SciPy for working with large arrays and matrices.

If you don’t mind diving into Python 3.x for your tools outside Rhino and Grasshopper, then you might want to consider a Python 3 distribution like Pyzo: http://www.pyzo.org/about_pyzo.html - a lot of useful tools for data processing come readily bundled.

/Nathan


#3

Hi @Willem,

This might be of interest https://pytools.codeplex.com/wikipage?title=PTVS%20Installation
If you are going to crunch numbers Pandas might be a good module to use (requires Numpy and some other dependencies). I have Anaconda installed http://docs.continuum.io/anaconda/index.html . With this you get a bunch of pre-installed packages (Numpy,SciPy, Pandas …).

Hope this helps,
-Miguel


(Willem Derks) #4

Hi @Miguel , and @jesterKing

Thank you for the replies, I see there is a long way to go to understand all aspects of this type of development. Apart from having to choose a python version to start with I now see that a IDE is a second choice to make.
Do you guys have anything to say on the subject of IDE’s?

Thanks
-Willem


(Steve Baer) #5

I use pycharm for all non-Rhino python development. It is an excellent tool. We actually do write quite a bit of python nowadays for our web sites.


(Nathan 'jesterKing' Letwory) #6

If you already have programmed before you may already have some coding tools you like a lot. In the end the best tool is the one you like best.

PyCharm looks quite nice indeed, but for my cross-language needs I normally stick to gvim - there is a plethora of plugins that make it a viable tool for many tasks. If one hasn’t used modal editors before it may be off-putting, so I wouldn’t recommend it here. Just illustrating that the tool you like best already probably is also the most useful for you :smiley: That said, I definitely should check out PyCharm, since it seems to support some frameworks I use a lot.