Python 3 query

I would like to learn Python. One major motivation is to learn scripting within Rhino. However I gather that Python 3 is not supported. Given the outside world, it makes no sense for me to start learning anything other than Python 3.

Will starting with Python 3 make Rhino scripting difficult enough I should just forget about it for now and study Python 3 only? I’m trying to understand my best strategy going forward.

I do not have much real-world coding experience, mostly just a lot of schooling a long time ago. I’m more of a 3D CAD designer but I can’t see learning two languages (or dialects, if you will) at once. That said, my intention is to increase my value as an engineer, not just improve my drafting.

What do you mean by ‘given the outside world’ ? I’d argue that Python is a good pick for first language coming from an engineering background and you wish to improve your Rhino working and data handling. It’s good for directly scripting Rhino and you can extend GH definitions with IronPython (syntax is basically same). Someone might come and tell you it’s not good, C# is faster and C# makes the real plugins and softwares etc and they’re not wrong but python might still be the correct pick based on your needs and preferences. It’s also slightly more intuitive and comprehensible in the beginning. Once you understand the programming principles, it’s gonna be much easier to pick up another language.

Seriously, the difference between Python 2.7 (as currently implemented in Rhino via IronPython) and Python 3 is not the same as say, trying to learn French after having mastered German. It’s more like going from a Texas drawl to Brooklynese… the grammar is basically the same, the details are different.

Plus, most good programmers learn a number of languages - the syntax is different in each one, but the same basic principles of programming logic hold for all.

Scripting in Rhino is also about learning how all the rhinoscript and RhinoCommon functions actually work to create and manipulate geometry and interact with Rhino files; that actually has nothing really to do with Python, it’s only the framework (one of the frameworks) used to access those functions.

So I wouldn’t worry about it too much. Jump in and start learning.

I would go for C#, since it has a more robust developing environment for other CAD/BIM platforms as well. It is also much faster than python when used correctly. After a while, you will generally pick up any programming language easily, because proper programming paradigms are universal regarding the language, just some syntax stuff will change here and there.

I am not a believer on the idea that "python is easier to pick up" Programming in general is difficult, and like anything it takes commitment, and you never stop learning new things and there is always things you will need to improve on.

My most important suggestion: Dont start your learning journey by watching tutorials on how to code in Grasshopper or Revit ( PyRevit… LOL) ect… learn from the alma matter, learn the core concepts first, from a book or some videos not related to architecture, and then make the transition. Who cares if the examples will talk about about Employee classes or Car classes. The most important thing: have the core principals understood before trying to rush ahead to fast.

Basically I agree with what has been replied so far.

But, as long as we speak of scripting Rhino, AFAIK, Rhino does not support C# scripting, unfortunately !

Only Grasshopper does …

Agree. Do it :snake: I learned Python 3 and Rhino Python together very happily, having never seriously learned to code before. Be aware that in CPython 3 you will quickly start to rely on libraries and packages which are not available in Rhino - that will frustrate you more than the changes in syntax but you will find workaround on this forum
Graham

2 Likes