last day (22 days later) » 

7:07 PM
1
A: Python3- Writing for loop output to file

user 5061This error is probably because you are giving an int to writelines(). Convert it to string. for x in range(0, int(anim_1_frame_length)): anim_.writelines(str(x)) As for the second part of your question, you can use \n in your printed string. Since i m not sure which variable your "frame...

 
Thanks that was it:) i was trying print >> in lue of that. but this is what i needed. writelines didnt write more than one line tho.
 
I have edited the question and included the newline print. If this is not what you needed, let me know.
 
EDIT just saw your post thanks man^_^
.writelines did not work, it wrote "0*21*22*23*24*25*26*27*28*29*210*211*212*2..." but i did anim_.writelines((str(x)) + ('*') + (frame_rate))
 
No problem. You can add '\n' to the string you provide to writelines(). It is the newline character.
 
oh awesome, thanks again man:) saved me alot of trial and error.
 
7:08 PM
Friendly tip: Dont take downvotes personally. Initially i felt like this as well, as i got my -3. The rules of this site are somewhat "strict" when questions arent clear or not useful for future visitors. However people are willing to help :) I will be deleting this comment later, since it doesnt contribute to programming and it will be flagged (rightfully) as "too chatty"
 
7:27 PM
Thanks for the tip man:) im just new to coding and i dont know anyone that codes so when im stuck sometimes. and i have nowhere to turn to.. when you google "coding help" stackoverflow is about the only thing to come up. i appreciate your kindness^_^
 

  last day (22 days later) »