Targeted Python Learning Resources?

Hi there,

I’m an avid grasshopper user, but quickly get lost outside of the visual scripting interface…

I’m curious if anyone can point me to some resources to help quick start my python coding journey? What topics would you suggest I research to start leveraging Rhino and LBT outside the grasshopper environment? (thinking mainly pollination app development)

What fundamental things do I need to understand? SDKs? APIs? notebooks? packages?

Realizing this is extremely open-ended, but appreciate any resource suggestions you may have that can help me focus my efforts as there’s only so much time in the day(+night)! :smiley:

3 Likes

Hi @jakechevrier ,

Have you looked at Rhino education?
It has some python courses for Rhino and you will write python scripts in rhino.
Understanding python will necessary if you want to read or edit some codes.

Unfortunately I can’t help too much but you will learn that a packages is like downloading a new plug-in for grasshopper (kinda).

Regards.

2 Likes

If you have access to LinkedIn learning, there ist also one very good cours for Python in Grasshopper (Ironpython), which pretty much explains the basics.

3 Likes

This is something I’m rather passionate about.
As someone who’s kind of taught themselves both programming and energy modeling, basically with LBT to be honest :sweat_smile:. The whole “Rhino, Grasshopper, Python” universe is E X P A N S I V E; though in the grand scope and scale of things; this is while HUGE, still a small niche; and I’d always wished there was a topical “crash course”, that may have saved a good deal of time! :smiley:

I’ll share a number of things; some may not be topical to your post specifically, but to also help others


quick notes:


In terms of python general:

Ive personally found realpython to be quite helpful, both the free, and also the paid to be pretty worth it if desired.

Though Niloofar Zaker’s ghpy intro can kind of serve as a bit of both


Part of what for me, seemed to make the initial learning curve steep was:

  • The importance of getting a virtual environment setup for individual projects.( just start every new project like this:
python -m venv .env

.env\scripts\activate

^^^^ Initially getting an enviornment setup, your dependencies installed and either in a file.py or a notebook.ipynb working so you can “do the things”, confidence and understanding purely in “how to get things setup so my code will run”, so you can write code, troubleshoot why it doesn’t work and validate it, that’s kinda the door, walk through it!

for me “ok I want to do this____” and then googling, referencing github/grasshopper etc and working on making it happen, was the most effective.


Don’t be afraid to copy and paste code, if it exists where you can see it that’s what it is for.

Google and Stackoverflow early.

Find a project(s) to focus on, and make a goal of sending a pull request to contribute to the codebase (if you don’t know now: don’t worry, if becomes relevant you will! if not, no worries! :slight_smile: )
Find a couple colleagues / friends who write python well and get to talking about it, ask questions and do the things!

HOPEFULLY some of that was helpful.
TLDR:
youtube/tutorials untill you can start hacking together working code, then work on making it better, continue/repeat as needed.

7 Likes

Thank you all for the recommendations! I’ll definitely be checking these out. Its funny because I don’t consider myself a beginning programmer (understand logic, data flows, if statements, etc.) but once i get out of GH i immediately feel like a total rookie.

I’m very passionate about it as well @TrevorFedyna, as i basically did the same thing! Mostly Chris’s videos :smiley:

1 Like

I feel like for me ipynb’s in vs code, were a nice little bridge between grasshopper and non grasshopper python! definitely helped alot, I still usually have one for each project i’m working on for on the fly test/check/ tinkering etc!

Furthermore, I recently discovered the NUS (National University of Singapore) offers a data science course with python and other subjects. Now that I’m a few hours in, I’d definitely recommend it. It is by Clayton Miller who is publishing interesting research about thermal comfort and more.

3 Likes