----- 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 ;)

Cheers, Alex

Reply via email to