import os
filePath = “C:\Users\siba\Desktop\1x1x1.blb”
BrickName = (os.path.splitext(os.path.basename(filePath))[0])
def ImportBLB(filePath):
file = open(filePath)
line = file.next()
while line:
if(line == "POSITION:
"):
POS1 = ‘[’ + file.next().replace(’ ‘,’, ‘).replace(’
‘,’’) + ‘]’
POS2 = ‘[’ + file.next().replace(’ ‘,’, ‘).replace(’
‘,’’) + ‘]’
POS3 = ‘[’ + file.next().replace(’ ‘,’, ‘).replace(’
‘,’’) + ‘]’
POS4 = ‘[’ + file.next().replace(’ ‘,’, ‘).replace(’
‘,’’) + ‘]’
try:
line = file.next()
except StopIteration:
break
file.close()
return
ImportBLB(filePath)
This code works perfectly fine in the Python IDLE, but the next() command does not appear to exist in Blender?
Python version is 2.7.5, and I’m running Blender 2.68.0