"Alex Vergara Gil" <a...@cphr.edu.cu> writes:

>   ----- Original Message ----- From: "Rainer M Krug" <rai...@krugs.de> Sent: 
> Tuesday, June 10, 2014 3:26 AM
>
>   Hi
>
>   In the thread "Python Graphics in LyX" it was shown nicely how other
>   programming languages can be used to include grahics generated by these
>   into a LyX Document. That made me thinking: How can I do the same for
>   text files generated by these external code blocks?
>
>   Obviously, this depends on the format of the text (ascii, LaTeX,
>   others?). What would be the workflow? Does the text has to be in a file
>   (I assume) or could it be redirected directly into LyX?
>
>   Somehow I have the feeling I am missing something trivial here...
>
>   Cheers,
>
>   Rainer
> Indeed! It can be produced as well, just define a python normal text
> file format type (as pytxt) and in the converter just add from the
> pytxt format to simple text format as python $$i $$o
> in the python script you have to output everything to a text file using the 
> lines
> import sys
> outputfile = open(sys.argv[1])
> outputfile.write('testing')
> outputfile.close
>
> Voilá! it works with text too
> Moreover in the converter you can define a csv output format and
> python handles well with csv, so I give you the rod, now fish
> something ;)

As I said - I have missed something trivial.

Suggestion: could you add these cases to your document about graphs from
Python? Especially the csv might be very useful.

Cheers,

Rainer

>
> Cheers, Alex

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      rai...@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

Attachment: pgpfDFEEurWzn.pgp
Description: PGP signature

Reply via email to