1
$\begingroup$

This code works perfectly fine outside of Blender, but the next() function does not appear to exist in Blender..

while line:
    if(line == "POSITION:\n"):
        POS1 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'
        POS2 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'
        POS3 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'
        POS4 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'

    try:
        line = file.next()
    except StopIteration:
        break
file.close()
return

(Not all of my code, just the part that reads my file)

$\endgroup$
  • $\begingroup$ Please post a sample script which shows the error and can run on its own, this seems like it may be more of a bug report too. $\endgroup$ – ideasman42 Oct 16 '13 at 21:56
1
$\begingroup$

Blender 2.6x comes with its own Python in Version 3.3.x, and in Py3k it's __next__().

You can do simpler, however:

for line in file:
    print(line)
$\endgroup$
0
$\begingroup$

u can try this:

:

with open("updated_test.csv",'w') as f1:
with open("Review.csv",'r+') as f:
    f.next()
    for line in f:
        f1.write(line)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.