Using Org-mode version 7.9.1 (release_7.9.1-163-g27101a @ c:/emacs/site-lisp/org-mode/lisp/), here's an example of some Python code with an output block:
#+name: read_excel #+begin_src python :results output :exports both from pandas import * import requests, StringIO xls = requests.get('http://www.econ.yale.edu/~shiller/data/chapt26.xls') f = io.parsers.ExcelFile(StringIO.StringIO(xls.content)) dat=f.parse('Data',skiprows=[0,1,3,4,5,6,7],index_col=0).dropna(thresh=3).ix[:,'P':'CPI'].convert_objects() print dat.head(5) #+end_src #+RESULTS: read_excel : NOTE *** Ignoring non-worksheet data named u'PDVPlot' (type 0x02 = Chart) : NOTE *** Ignoring non-worksheet data named u'ConsumptionPlot' (type 0x02 = Chart) : P D E R RLONG CPI : 1871 4.44 0.26 0.40 6.35 5.32 12.464061 : 1872 4.86 0.30 0.43 7.81 5.36 12.654392 : 1873 5.11 0.33 0.46 8.35 5.58 12.939807 : 1874 4.66 0.33 0.46 6.86 5.47 12.368896 : 1875 4.54 0.30 0.36 4.96 5.07 11.512651 When I export this org file to HTML, the output block has the same format (colors, etc.) as the source block. When I export to PDF via LaTeX, however, the result block seems to get formatted as regular text, and looks nothing like the source block. Is there any way to get the same formatting for the result block as for the source block when exporting to LaTeX/PDF? Thanks. Richard Stanton