On Wed, Mar 27, 2013 at 4:23 PM, Amit Saha <amitsaha...@gmail.com> wrote: > Hi Sayan, > > On Wed, Mar 27, 2013 at 4:14 PM, Sayan Chatterjee > <sayanchatter...@gmail.com> 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 parameter and then stitch >> them up. >> >> 1) Is it possible to automatically generate different data files( say in the >> orders of 1000) with different names depending on a parameter? > > It certainly is. Are you talking about the file names being > file_1001.txt, file_1002.txt and so on? If yes, let's say your > parameter values are stored in param. Then something like this would > do the trick: > > param_values = [1000,1001, 1005, 2001] > > for param in param_values: > fname = 'file_' + str(param) > > > # write to file fname > # > # > > > Sorry if its different from what you are looking for. But yes, its > certainly possible. > > >> >> 2) Is it possible to plot the data sets right from Python itself and save >> the plots in different jpeg files to stitched upon later on. > > It is possible to generate plots and save each as JPEGs. [1]. > > What do you mean by stitching together?
You probably meant creating an animation from them. Yes, it is certainly possible. I will try to find a link which makes it really easy to create an animation out of a bunch of images. Which operating system are you on? -Amit. -- http://amitsaha.github.com/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor