you right I need to modify a list from a file to add some fields then resave it
but how do you get rid of these /n thing?
if I print the value before I save it I don’t see this
thing!
also how come the
is added not at then end of the line but on last list item ?
how do you read line without taking in the
thing ?
I do need one list per line
and problem is that the first file I did
did not have list per line but only float list
and I need to modify the each line to add some new fields !
then save it so that I can change each line as a list with the brackets
then I can re use it in a py file and define all lines as a list of list
for data in a script !
If you don’t have to do this in Blender, maybe you should look at the Pandas library, which helps you to deal with data like what you are describing. There is also a csv module in the standard library.
If you have further problems, please post some code.
you can strip whitespace by calling line = line.strip()
or you can strip the last character ("
") off with line = line[:-1]
Also, this is the kind of question where google will help you more quickly. Stackoverflow is full of Python beginners’ questions like this.