Hello, I’m new with python script and I dont know how to realise this code. Hope you can help me.
a, b, c and e are lists and d and f are numbers
Thank you
Hello, I’m new with python script and I dont know how to realise this code. Hope you can help me.
a, b, c and e are lists and d and f are numbers
Thank you
hello @thomas.1
you have several indentation problems read this
Python Statement, Indentation and Comments.
or this (in french)
3 erreurs d'indentation (et comment y remédier) - Docstring
and E
in your script is not a list (replace by e
? )
Note concerning the request for help on python scripts on the forum
- show the error (screenshot of the traceback)
- copy and paste the python code and format it with the button </> to avoid re-entering the code for the person who will want to help you
Thank you for answering me,
I still have problems with the code and dont know how to fix them. When I correct one, another one is coming
# Charger les bibliothèques DesignScript et Standard Python
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Affectation des entrées aux variables
a=IN[0]
b=IN[2]
c=IN[1]
d=IN[3]
f=IN[4]
# Déclaration d'une liste
e=[]
#Code
i = 0
for i in range (d-1):
B = b[i]
E = e[i] = 0
j = 0
for j in range (f-1):
A = a[j]
C = c[j]
if B == A:
E = E+C
# Affectez la sortie à la variable OUT.
OUT = e
Ok I find it, its because e was empty and so I cant call e[i]