View Single Post
Old 11th February 2016, 01:46   #10  |  Link
konstantin1
Registered User
 
Join Date: Mar 2014
Posts: 38
Modified version of python script macro, collects frame numbers as I need, more structured and visible way,
100-200
350-500
etc...

maybe useful for others too:

Code:
frame_number = str(avsp.GetFrameNumber())

with open("test.txt", "r") as myfile:
    content=myfile.read()

if ((content=="") or (content[-1]=="\n")):
    to_write=frame_number+"-"
else:
    to_write=frame_number+"\n"

if not(content == ""):
	if content[-1]=="\n":
	    last_fn=content.split("\n",10000000)[-2].split("-",2)[-1]
	else:
	    last_fn=content.split("\n",10000000)[-1].split("-",2)[-2]
else:
    last_fn=""
    
if not(last_fn==frame_number):
    with open("test.txt", "a") as myfile:
        myfile.write(to_write)

Last edited by konstantin1; 11th February 2016 at 01:59.
konstantin1 is offline   Reply With Quote