Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fname = 'tmp.txt'
- # Read the file and get each line as an array item
- src = open(fname, 'r').readlines()
- src = [line.strip() for line in src]
- # Loop and split the line into items
- for line in src:
- data = line.split(',')
- name = data[0]
- pos = [ float(d) for d in data[1:4] ] # Get elements 1,2,3 as pos and convert them from string to float
- rot = [ float(d) for d in data[4:7] ] # Get elements 4,5,6 as rotation and convert
- scale = [ float(d) for d in data[7:] ] # Get elements from 7 to the end as scale and convert
- print name, pos, rot, scale
Advertisement
Add Comment
Please, Sign In to add comment