From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?TWFydGluIFNjaMO2w7Zu?= Subject: Trouble with Tables and Python Date: Tue, 15 Apr 2014 23:18:42 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c2a240357ccf04f71b58c0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaAkf-0006OT-Cg for emacs-orgmode@gnu.org; Tue, 15 Apr 2014 17:18:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WaAkd-0002R6-Ut for emacs-orgmode@gnu.org; Tue, 15 Apr 2014 17:18:45 -0400 Received: from mail-qa0-x229.google.com ([2607:f8b0:400d:c00::229]:58577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaAkd-0002Qy-OM for emacs-orgmode@gnu.org; Tue, 15 Apr 2014 17:18:43 -0400 Received: by mail-qa0-f41.google.com with SMTP id j5so10007811qaq.28 for ; Tue, 15 Apr 2014 14:18:43 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a11c2a240357ccf04f71b58c0 Content-Type: multipart/alternative; boundary=001a11c2a240357ccb04f71b58be --001a11c2a240357ccb04f71b58be Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is my first post here... I have been using org-mode as a pure TODO-tool for some time but this winter I realised it could be used for much more and I have been experimenting with mixing in LaTeX and Python for fun and because I find literate programming a particularly sane idea (I am a HW engineer). Less than I week ago I started to look into using tables for input and output to/from Python scripts. I was inspired by something I found at http://kitchingroup.cheme.cmu.edu/ . The enclosed example 1 file is a pruned version of the org-file I found there. If I run the embedded Python script using C-c C-c I don't get the table shown in the example. Instead I get "none" on the row following "#+RESULTS:" If I change ":results raw" to ":results output" I do get the table but 'wrapped' in "#+begin_example" and "#+end_example" as shown in the enclosed example 2 file. I have done some further testing/changes in that file (adding some stuff to the top of the file and changing the formatting of the print statements) none of which changed the extra wrapping of the table. When I export to LaTeX -> PDF the table does not show up in the end result. Let's move over to the third example file and the real mystery. This all my own code. Reading data from the first table works just fine and the same goes for the calculations. The output table, however, is different from that of example 2. The 'wrapper' is gone but each row is starting with ": ". Where does that come from? Why does it differ from example 2? If my results differ from someone else's (different install/versions etc) -- OK. But how can I get differences like this on my own? To my un-trained eyes the print statements of examples 2 and 3 look very similar. (But, the first things that go blind are the eyes... probably something blatantly obvious once pointed out to me.) OS: #! Linux (Based on Debian stable, 64-bit) Emacs: 23.4.1 Org-mode: 8.2.5h Python: 2.7.3 TIA, --=20 Martin Sch=C3=B6=C3=B6n http://hem.bredband.net/b262106/index.html --001a11c2a240357ccb04f71b58be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This is my f= irst post here...

I have been using org-mode as a= pure TODO-tool for some time but this winter= I realised it could be used for much more and I have been experimenting wi= th mixing in LaTeX and Python for fun and bec= ause I find literate programming a particularly sane idea (I am a HW engineer).

Less than I week ago I started to look into using ta= bles for input and output to/from Python scripts. I was inspired by somethi= ng I found at http://kitchingroup.cheme.cmu.edu/ . The enclosed example 1 file is a pruned version of the= org-file I found there. If I run the embedded Python script using C-c C-c = I don't get the table shown in the example. Instead I get "none&qu= ot; on the row following "#+RESULTS:"

If I change ":results raw" to ":resul= ts output" I do get the table but 'wrapped' in "#+begin_e= xample" and "#+end_example" as shown in=C2=A0 the enclosed e= xample 2 file. I have done some further testing/changes in that file (addin= g some stuff to the top of the file and changing the formatting of the prin= t statements) none of which changed the extra wrapping of the table. When I= export to LaTeX -> PDF the table does not show up in the end result.

Let's move over to the third example file and th= e real mystery. This all my own code. Reading data from the first table wor= ks just fine and the same goes for the calculations. The output table, howe= ver, is different from that of example 2. The 'wrapper' is gone but= each row is starting with ": ". Where does that come from? Why d= oes it differ from example 2? If my results differ from someone else's (different install/versions etc) -- OK. But h= ow can I get differences like this on my own? To my=C2=A0 un-trained eyes the print statements of examples 2 and 3 look = very similar. (But, the first things that go blind are the eyes... probably something blatantly obvious once pointed out= to me.)

OS: #! Linux (Based on Debian= stable, 64-bit)
Emacs: 23.4.1
Org-mode: 8.2.5h
Python: 2.7.3

<= /div>
TIA,
--001a11c2a240357ccb04f71b58be-- --001a11c2a240357ccf04f71b58c0 Content-Type: application/octet-stream; name="table_making_example_1.org" Content-Disposition: attachment; filename="table_making_example_1.org" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hu1nji7p0 KiBET05FIFVzaW5nIGRhdGEgaW4gYSB0YWJsZSBpbiBhbm90aGVyIG9yZy1maWxlCiAgQ0xPU0VE OiBbMjAxMy0xMi0yMiBTdW4gMTM6NDJdCiAgOlBST1BFUlRJRVM6CiAgOmNhdGVnb3JpZXM6IG9y Zy1tb2RlCiAgOmRhdGU6ICAgICAyMDEzLzEyLzIyIDEzOjQyOjIwCiAgOnVwZGF0ZWQ6ICAyMDE0 LzAxLzE2IDA3OjMwOjMwCiAgOkVORDoKClRoaXMgZmlsZSBpcyBhbiBleHRyYWN0IGZyb20gVXNp bmctZGF0YS1pbi1hLXRhYmxlLWluLWFub3RoZXItb3JnLWZpbGUub3JnIE9yaWdpbmFsbHkgZG93 bmxvYWRlZCBmcm9tIFtbaHR0cDovL2tpdGNoaW5ncm91cC5jaGVtZS5jbXUuZWR1L2Jsb2cvY2F0 ZWdvcnkvb3JnLW1vZGUvNC9dXQoKIytCRUdJTl9TUkMgcHl0aG9uIDpyZXN1bHRzIHJhdwppbXBv cnQgbnVtcHkgYXMgbnAKCnByaW50ICcjK3RibG5hbWU6IGNvcy1kYXRhJwpwcmludCAnfCB4IHwg Y29zKHgpfCcKcHJpbnQgJ3wtJwoKZm9yIHggaW4gbnAubGluc3BhY2UoMCwgMipucC5waSwgMTAp OgogICAgcHJpbnQgJ3x7MH18ezF9fCcuZm9ybWF0KHgsIG5wLmNvcyh4KSkKIytFTkRfU1JDCgoj K1JFU1VMVFM6CiMrdGJsbmFtZTogY29zLWRhdGEKfCB4IHwgY29zKHgpfAp8LQp8MC4wfDEuMHwK fDAuNjk4MTMxNzAwNzk4fDAuNzY2MDQ0NDQzMTE5fAp8MS4zOTYyNjM0MDE2fDAuMTczNjQ4MTc3 NjY3fAp8Mi4wOTQzOTUxMDIzOXwtMC41fAp8Mi43OTI1MjY4MDMxOXwtMC45Mzk2OTI2MjA3ODZ8 CnwzLjQ5MDY1ODUwMzk5fC0wLjkzOTY5MjYyMDc4NnwKfDQuMTg4NzkwMjA0Nzl8LTAuNXwKfDQu ODg2OTIxOTA1NTh8MC4xNzM2NDgxNzc2Njd8Cnw1LjU4NTA1MzYwNjM4fDAuNzY2MDQ0NDQzMTE5 fAp8Ni4yODMxODUzMDcxOHwxLjB8Cgo= --001a11c2a240357ccf04f71b58c0 Content-Type: application/octet-stream; name="table_making_example_2.org" Content-Disposition: attachment; filename="table_making_example_2.org" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hu1nji8h1 IytMQVRFWF9DTEFTUzogYXJ0aWNsZQojK0xBVEVYX0NMQVNTX09QVElPTlM6IFthNHBhcGVyXQoj K09QVElPTlM6IHRvYzpuaWwgXjp7fQojK1NUQVJUVVA6IGhpZGVibG9ja3MKIytUSVRMRTogUGxh eWluZyB3aXRoIFB5dGhvbiBhbmQgdGFibGVzCiMrQVVUSE9SOiBNYXJ0aW4gU2Now7bDtm4KClRo aXMgZmlsZSBpcyBhIG1vZGlmaWVkIGV4dHJhY3QgZnJvbSBVc2luZy1kYXRhLWluLWEtdGFibGUt aW4tYW5vdGhlci1vcmctZmlsZS5vcmcgT3JpZ2luYWxseSBkb3dubG9hZGVkIGZyb20gW1todHRw Oi8va2l0Y2hpbmdyb3VwLmNoZW1lLmNtdS5lZHUvYmxvZy9jYXRlZ29yeS9vcmctbW9kZS80L11d CgojK0JFR0lOX1NSQyBweXRob24gOnJlc3VsdHMgb3V0cHV0CmltcG9ydCBudW1weSBhcyBucAoK cHJpbnQgJyMrdGJsbmFtZTogY29zLWRhdGEnCnByaW50ICd8IHggfCBjb3MoeCl8JwpwcmludCAn fC0nCgpmb3IgeCBpbiBucC5saW5zcGFjZSgwLCAyKm5wLnBpLCAxMCk6CiAgICBwcmludCAnfCAl NS40ZiB8ICU1LjRmIHwnICUgKHgsbnAuY29zKHgpKQojK0VORF9TUkMKCiMrUkVTVUxUUzoKIyti ZWdpbl9leGFtcGxlCiMrdGJsbmFtZTogY29zLWRhdGEKfCB4IHwgY29zKHgpfAp8LQp8IDAuMDAw MCB8IDEuMDAwMCB8CnwgMC42OTgxIHwgMC43NjYwIHwKfCAxLjM5NjMgfCAwLjE3MzYgfAp8IDIu MDk0NCB8IC0wLjUwMDAgfAp8IDIuNzkyNSB8IC0wLjkzOTcgfAp8IDMuNDkwNyB8IC0wLjkzOTcg fAp8IDQuMTg4OCB8IC0wLjUwMDAgfAp8IDQuODg2OSB8IDAuMTczNiB8CnwgNS41ODUxIHwgMC43 NjYwIHwKfCA2LjI4MzIgfCAxLjAwMDAgfAojK2VuZF9leGFtcGxlCgoK --001a11c2a240357ccf04f71b58c0 Content-Type: application/octet-stream; name="table_making_example_3.org" Content-Disposition: attachment; filename="table_making_example_3.org" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hu1nji8s2 IytMQVRFWF9DTEFTUzogYXJ0aWNsZQojK0xBVEVYX0NMQVNTX09QVElPTlM6IFthNHBhcGVyXQoj K09QVElPTlM6IHRvYzpuaWwgXjp7fQojK1NUQVJUVVA6IGhpZGVibG9ja3MKIytUSVRMRTogUmVh ZGluZyBhbmQgd3JpdGluZyB0YWJsZXMgdXNpbmcgUHl0aG9uCiMrQVVUSE9SOiBNYXJ0aW4gU2No w7bDtm4KCiogSW5wdXQKCiMrdGJsbmFtZTogaW5wdXRfdGFibGUKf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