Can anyone tell me why this simple script doesn’t work - I’m a beginner with python, I’ve tried looking at other custom python nodes to match the input procedure but just cant get it to do anything.
The ultimate purpose of this will be part of a script to take a file path as input and move up a level for the output, by reversing the path , deleting up to the first \ character (i couldn’t find a node that does that starting from the right) then reversing it again. If anyone knows of a simpler method that would be most helpful.
eg input = “G:\4900\4976 Weavers Quay”
output = “G:\4900”
Enable Python support and load DesignScript library
from Autodesk.DesignScript.Geometry import *
The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
Place your code below this line
Python code to reverse a string
revme = IN
str = “”
for i in revme:
str = i + str
OUT = str