[Tutor] saving output data in a file

Prasad Mehendale prachit915 at gmail.com
Fri Dec 4 08:43:42 CET 2009


I am a beginner. I want to save the output data of the following programme in 
a file through the programme. Please suggest me the way. I am using Python 
2.3.3 on mandrake linux 10 and using "Idle" to save the output to a file 
presently. 
Thanks in advance.

#programme to calculate various parameters for a dc-generator.
import math
#import os
#flux is assumed to be .005Wb, and A=parallel paths = 2 for wave winding
polerpm=[]
for ConductorsPerSlot in range(1,11):
    """ we consider that output voltage is 20 V DC """
    PoleRpmProduct=20000/ConductorsPerSlot
    polerpm.append(PoleRpmProduct)
print '(Pole*RPM) product for various values of conductors/slot is: \n', 
polerpm
for poles in range(2,18,2):
    print
    print '\n For number of poles='+str(poles) +'  RPM values are: '
    for i in range(len(polerpm)):
                   rpm=polerpm[i]/poles
                   print rpm,



-- 
     --prasad mehendale
        


More information about the Tutor mailing list