Something like:
# before loop..
f = open('filename.dat','w')
#
# setup scene etc..
ball = sphere(....)
while True:
ball.pos = blah blah...
f.write("%f, %f, %f\n" % (ball.pos.x, ball.pos.y, ball.pos.z))
# after loop
f.close()
would that do it?
-steve
On Sep 13, 2010, at 4:49 PM, Paul D. Price wrote:
> Friends,
>
> This is likely more of a Python question, but what is the best way to export data as a CSV file. For example, if I want to print coordinate data to a file, say ball.pos.x, and ball.pos,y, what is the sequence I would go through to open the file, write to it, and then close it?
>
> Thanks,
> Paul
> _______________________
> Paul D. Price
> Science Department Chairman
> Trinity Valley School
> Fort Worth, TX 76132
> tv...@sb...
>
>
>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Visualpython-users mailing list
> Vis...@li...
> https://lists.sourceforge.net/lists/listinfo/visualpython-users
|