Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Peter Otten
Sayan Chatterjee wrote: > for t in range(0,200): > fname = 'file_' + str(t) > > So it will assign fname values file_0, file_1 so on. Dropping the quotes > is giving me > > IOError: [Errno 2] No such file or directory: 'file_0' > > > Indeed the file is not present. In C we write,if we have to

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Sayan Chatterjee
Oh yes, thanks. That worked. :) On 27 March 2013 21:58, Bod Soutar wrote: > You were opening the file for reading, rather than writing. It > therefore was expecting to find a file. > Change > fo = open('fname','r+') > to > fo = open('fname','w') > > Bodsda > > On 27 March 2013 16:17, Sayan Chat

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Bod Soutar
You were opening the file for reading, rather than writing. It therefore was expecting to find a file. Change fo = open('fname','r+') to fo = open('fname','w') Bodsda On 27 March 2013 16:17, Sayan Chatterjee wrote: > for t in range(0,200): > fname = 'file_' + str(t) > > So it will assign fname

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Sayan Chatterjee
Putting "w" instead of "r+" probably solves the problem. The error is not showing now. On 27 March 2013 21:47, Sayan Chatterjee wrote: > for t in range(0,200): > fname = 'file_' + str(t) > > So it will assign fname values file_0, file_1 so on. Dropping the quotes > is giving me > > IOError: [

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Sayan Chatterjee
for t in range(0,200): fname = 'file_' + str(t) So it will assign fname values file_0, file_1 so on. Dropping the quotes is giving me IOError: [Errno 2] No such file or directory: 'file_0' Indeed the file is not present. In C we write,if we have to record data in a file FILE *fp fp = fopen(

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Walter Prins
Hello, On 27 March 2013 15:59, Sayan Chatterjee wrote: > Hi Amit, > > fo = fopen('fname','r+') > fo.write("%d %d",j,counter) > > > Is giving the following error: > > File "ZA.py", line 30, in > fo = open('fname','r+') > IOError: [Errno 2] No such file or directory: 'fname' > > Where is th

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Joel Goldstick
On Wed, Mar 27, 2013 at 11:59 AM, Sayan Chatterjee < sayanchatter...@gmail.com> wrote: > Hi Amit, > > fo = fopen('fname','r+') > fo.write("%d %d",j,counter) > > > Is giving the following error: > > File "ZA.py", line 30, in > fo = open('fname','r+') > IOError: [Errno 2] No such file or dire

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-27 Thread Sayan Chatterjee
Hi Amit, fo = fopen('fname','r+') fo.write("%d %d",j,counter) Is giving the following error: File "ZA.py", line 30, in fo = open('fname','r+') IOError: [Errno 2] No such file or directory: 'fname' Where is the mistake? Cheers, Sayan On 27 March 2013 12:20, Amit Saha wrote: > On

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-26 Thread Sayan Chatterjee
Yes, ffmpeg will do if multiple plots can be generated using mathplotlib . I'll look up the links you provided and get back to you, if I can't figure it out. :) On 27 March 2013 12:12, Amit Saha wrote: > On Wed, Mar 27, 2013 at 4:36 PM, Sayan Chatterjee > wrote: > > Thanks a lot for your pro

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-26 Thread Amit Saha
On Wed, Mar 27, 2013 at 4:36 PM, Sayan Chatterjee wrote: > Thanks a lot for your prompt reply. > > 1. Yes. This is exactly what I wanted. Creating a bunch of data sets and > then writing script to plot them using gnuplot, but if something can produce > directly 'plots' it will certainly be helpful

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-26 Thread Sayan Chatterjee
Thanks a lot for your prompt reply. 1. Yes. This is exactly what I wanted. Creating a bunch of data sets and then writing script to plot them using gnuplot, but if something can produce directly 'plots' it will certainly be helpful. 2. Yes. By stitching them up I meant an animation.Sorry for the

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-26 Thread Amit Saha
On Wed, Mar 27, 2013 at 4:23 PM, Amit Saha wrote: > Hi Sayan, > > On Wed, Mar 27, 2013 at 4:14 PM, Sayan Chatterjee > wrote: >> Dear All, >> >> I am a newbie to Python but have a fair know how of other languages i.e C >> etc. >> >> I want to run an astrophysical simulation in Python. All I have t

Re: [Tutor] HELP: Creating animation from multiple plots

2013-03-26 Thread Amit Saha
Hi Sayan, On Wed, Mar 27, 2013 at 4:14 PM, Sayan Chatterjee wrote: > Dear All, > > I am a newbie to Python but have a fair know how of other languages i.e C > etc. > > I want to run an astrophysical simulation in Python. All I have to do it to > generate a set of 'plots' depending on a varying pa