Lesson 01: Python Data Types

Software: 
Tag: 
Video Duration: 
18 minutes
Author: 
Zach Downey

OK, in this tutorial we take a look at some of the basic data types in python and give a brief intro to Rhino's script editor. We walk through the debugger and the process of setting breakpoints in your script so that you can use the debugger to get useful information about how your code is executed. We don't actually get into any Rhino specific stuff yet, but we are layering up a good foundation for awesome scripts to come.

 

Here are some other good resources that go into a lot more depth if you are interested in further study.

RhinoPython Primer 

RhinoPython Wiki Resources

#Python Data Types
#Use Rhino's Script Debugger to View the Data Types
 
import rhinoscriptsyntax as rs
 
#Commets # character is use to comment out lines
 
#Special Data Type
x = None
 
#Number Data Types
x = 0
x = 1
x = -1
x = 1.0
x = 3.14
x = 3.14j
 
#Booleans
x = True
x = False
 
#Sequence Data Types
x = "Helo World"
x = 'Hello World'
x = ['h', 'e', 'l', 'l', 'o']
x = [1,2,3,4,5]
x = [1,"2",'3',"Strings"]
x = (1,2,3)
 
#Mapping Data Type
x = {0:'w', 1:'o', 2:'r', 3:'l', 4:'d'}
 
 
x = None
Tutorial Files: 

Rating

Please rate this tutorial below. Thanks.

4
Average: 4 (15 votes)

Comments

I'm glad I found this site, going to watch these series to learn how to create my own tools in RH/GH, cool stuff.

Want to Contribute?

Want to be an author? Drop us a line here we'd love to have you.

Already have a video you'd like to post? Send us a link and we'll get you going.

:)