Dynamo, Python library and finding what I can import from it

Hi all,

I would like to understand how “importing” works, vague I know but I hope to get better at asking my quesions as I understand more.

I ran across a post here, that allowed a pythin script to act as a File.FromPath node

from System.IO import FileInfo
file = FileInfo(IN[0])

My first question is ‘from System.IO import FileInfo’ Where do I start to look to find what I an import from System.IO, how do I find what I can import from this and different libraries?

I am new to python and programming in general, I have much experiance with AutoLisp, so I sort of understand some concepts but lost most of the time.

Thanks any help

Hi @cadman6735

Once you import System you just have to type OUT = dir(System.IO) to get all libraries. Cheers!

1 Like

This AU presentation goes over some good stuff with Python and Dynamo / Revit

1 Like

If you want more info on libraries of Python, Dynamo uses 2.7 version of python so you can search using that. The main 2.7 website is here: https://docs.python.org/2.7/
And here are the libraries: https://docs.python.org/2.7/library/

All great starting points

Thank you very much