Heya

So I'm playing with some ways of storing data and then loading it again. I got 
the part of saving it to HDD. But once I want to load it, I kind of run in some 
issues. Because all data I can save is being stored "linearly" so its just 
"matterial 1 material 1 material 1"

now to load the file I go with this so far :

import maya.cmds as mc
myFileObject=open('C://data2.txt', 'r')
theLines = myFileObject.readlines()
count = 0
for line in theLines:
    theLine = theLines[count]
    theSplit = str.split(theLine)
    theValueS = theSplit[0]
    theFrameS = theSplit[1]
    print theSplit
    print theValueS
    print theFrameS

but where I type theSplit[0] it only (naturally) select the string that is in 
[]. How can I select every second string? so 0-2-4-6-8, and then 1-3-5-7-9. I 
guess I need some math skill for this one.(I guess I should pay more attention 
in school)

But on the other hand I'm not sure that is the best way to go. With sets of 
data of 2 that would work(where I got material + value) but if I got 2 values 
then I'm in trouble so maybe I should save the data to txt file with some index 
list so that I can pick 1-10 strings for names, 11-20 for values and so on... 

so I save index list of how many materials I have and then use that separate 
and pick data somehow humh... 

What do you guys think? 

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to