Debug in ignition

Is there any debug in Ignition ?

Please be more specific, is there a specific problem you are trying to solve?

Just a debugger as every program as visual studio code and do you know how to erase or delete a list in the script ?

No, there is no built in debugger like in VS, you would need to use things like the script console and print statements.

And about delete a list?

I don’t know what you mean by delete, you can set a list to nothing though.

myList = []

Or just erase a list as clear

You need to explain, what you are trying to do and where you are trying to do it.

“list” could mean many different things, for instance you could be talking about a Vision Table Component, a Perspective Table Component, and Perspective Array Property, or a Python variable of List Type in a script.

I wrote in the script in the second reply, type is string

If you have defined a list in a script and you want to “clear” the list then as @josborn has shown you would do something like:

my_list = [1,2,3,4]
print my_list
my_list = []
print my_list

A list variable will be destroyed when it is no longer in scope, so there is no need to really worry about cleaning up variables.

I suppose if you really felt you needed to you could do:

my_list = None

but there is no need.

And what about the .clear()?
Because is available in dictionaries but just that

I think that’s for python 3.x, ignition uses python 2.7

Go it , thanks

Thank you so much

Had to google it, but there are actually several ways to clear a list

myList = []
del myList[:]
myList *= 0

All will produce an empty list.

How can I copy a list , I think in ignition don’t work .copy()
So there is an option list(OriginalList)

A shallow copy of a list is just myCopy = list(otherList).
For a deep copy, use copy.deepcopy.

Thanks