Hi all, trying to use a function to output a latex file using python with #+call. The example below does work but when pycalltest gets too big it just output "nil". When I call pycalltest directly with C-c C-c it works even with a big function. Is there a size limit when I use #+call ? Thanks for help, Martin #+name: pycalltest(trans=translation,items=items,cust=customer,deta=details,lang="german",cur="chf") #+begin_src python :results output execfile('latex.py') print lx_config #+end_src #+call: pycalltest(translation,items,customer,details,"german","chf") :file "test.tex"
Martin Halder <martin.halder@gmail.com> wrote:
> Hi all,
>
> trying to use a function to output a latex file using python with =
> #+call.
>
> The example below does work but when pycalltest gets too big it just =
> output "nil".
> When I call pycalltest directly with C-c C-c it works even with a big =
> function.
>
> Is there a size limit when I use #+call ?
>
> Thanks for help,
> Martin
>
> #+name: =
> pycalltest(trans=3Dtranslation,items=3Ditems,cust=3Dcustomer,deta=3Ddetail=
> s,lang=3D"german",cur=3D"chf")
> #+begin_src python :results output
> execfile('latex.py')
> print lx_config
> #+end_src
> #+call: pycalltest(translation,items,customer,details,"german","chf") =
> :file "test.tex"
Can you please provide all the pieces needed to run this? I presume at least
latex.py is needed - anything else?
Thanks,
Nick
Am 24.03.2012 um 20:00 schrieb Nick Dokos:
> Martin Halder <martin.halder@gmail.com> wrote:
>
>> Hi all,
>>
>> trying to use a function to output a latex file using python with =
>> #+call.
>>
>> The example below does work but when pycalltest gets too big it just =
>> output "nil".
>> When I call pycalltest directly with C-c C-c it works even with a big =
>> function.
>>
>> Is there a size limit when I use #+call ?
>>
>> Thanks for help,
>> Martin
>>
>> #+name: =
>> pycalltest(trans=3Dtranslation,items=3Ditems,cust=3Dcustomer,deta=3Ddetail=
>> s,lang=3D"german",cur=3D"chf")
>> #+begin_src python :results output
>> execfile('latex.py')
>> print lx_config
>> #+end_src
>> #+call: pycalltest(translation,items,customer,details,"german","chf") =
>> :file "test.tex"
>
> Can you please provide all the pieces needed to run this? I presume at least
> latex.py is needed - anything else?
could reduce the problem to a small example, seems the table is handled differently when using #+call.
direct evaluation:
[['country', 'Schweiz', 'Switzerland']]
using call:
[['field', 'german', 'english'], None, ['country', 'Schweiz', 'Switzerland']]
#+tblname: transl
| field | german | english |
|---------+---------+-------------|
| country | Schweiz | Switzerland |
#+name: pycalltest(trans=transl)
#+begin_src python :results output
print trans
#+end_src
#+call: pycalltest(transl) :file "test.tex"
Am 24.03.2012 um 20:00 schrieb Nick Dokos:
> Martin Halder <martin.halder@gmail.com> wrote:
>
>> Hi all,
>>
>> trying to use a function to output a latex file using python with =
>> #+call.
>>
>> The example below does work but when pycalltest gets too big it just =
>> output "nil".
>> When I call pycalltest directly with C-c C-c it works even with a big =
>> function.
>>
>> Is there a size limit when I use #+call ?
>>
>> Thanks for help,
>> Martin
>>
>> #+name: =
>> pycalltest(trans=3Dtranslation,items=3Ditems,cust=3Dcustomer,deta=3Ddetail=
>> s,lang=3D"german",cur=3D"chf")
>> #+begin_src python :results output
>> execfile('latex.py')
>> print lx_config
>> #+end_src
>> #+call: pycalltest(translation,items,customer,details,"german","chf") =
>> :file "test.tex"
>
> Can you please provide all the pieces needed to run this? I presume at least
> latex.py is needed - anything else?
ok, found with options hlines and colnames I get the same result for direct evaluation
and call. Problem solved, thanks and sorry for the noise.
Martin
** input table translation
#+tblname: transl
| field | german | english |
|---------+---------+-------------|
| country | Schweiz | Switzerland |
#+name: pycalltest(trans=transl)
#+begin_src python :results output :hlines yes :colnames no
print trans
#+end_src
#+call: pycalltest(transl) :file "test.tex"