Category definition for Scripting

Topics related to RhinoScript and Python scripting.

Syntax Highlighting:

Format and highlight your script code by fencing your code block within three back ticks. If you name the language your script is in, you get syntax highlighting, too:


Python:

```python

# Your python code here

print “Hello Pythonic World”

```

becomes

#Your python code here
print "Hello Pythonic World"

VBScript:

```vbscript

’ Your VBScript code here

print “Hello VBScript”

```

becomes

' Your VBScript code here
print "Hello VBScript"
1 Like

Hi Steve,
Perhaps we can put up a sticky on how to post source code? Learning from the old Python/Grasshopper forums, this was always an issue.
Best,
Anders

I added information on formatting code to the main sticky at the top of this category - does that help?

It does indeed, looks very nice.


# Testing Discourse source code posting
class SomeClass(object):

    """docstring for SomeClass"""

    def __init__(self, gratitude):
        self.gratitude = gratitude

    def thanksBrian(self):
        """docstring for method"""
        for i in range(self.gratitude):
            print "Thanks Brian, looks great!"

test = SomeClass(1000)
test.thanksBrian()

6 Likes