I am trying to print out to a file from python so that I can immediately copy and paste the output into WinEdit to make a tabular.
Example of current code is as follows:
sys.stdout = open('C://...', 'w')
for i in xrange(len(freq)):
if freq[i] > 3725.90649 and freq[i] < 3725.94165:
print '{:>2} {:>1} {:>23} {:>1} {:>9} {:>12} {:>10}{:>3}{:>12}'.format(1, "&", "3725.90649 - 3725.94165", "&", freq[i], "$\rightarrow", Tline[i], J_i[i], ")$ \\ \hline")
sys.stdout.close()
I want to get the output:
1 & 3725.90649 - 3725.94165 & 3725.9194 $\rightarrow R_{+}^{-}(3.5 )$ \\ \hline
But instead I get this:
1 & 3725.90649 - 3725.94165 & 3725.9194 $ightarrow R_{+}^{-}(3.5 )$ \ \hline
What is going on in the code? How can I get the desired output?