[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: implicitly running a lilypond script through a python script before
From: |
Thomas Morley |
Subject: |
Re: implicitly running a lilypond script through a python script before compilation |
Date: |
Mon, 2 May 2016 00:21:37 +0200 |
2016-05-01 22:48 GMT+02:00 Joseph Chrestien <address@hidden>:
> Hi all,
>
> I know this is going to sound strange: is it possible (or even imaginable) to
> run a Python code snippet from "within" Lilypond code at compile time?
Yes, see this thread in the german forum
http://www.lilypondforum.de/index.php?topic=2087.0
discussed are different possibilities:
(1) python from within a lilyfile.ly:
Example:
The file hello-world.py contains:
print "Hello World!"
In a .ly-file:
pyMx =
#(define-void-function (parser location)()
(system "python hello-world.py")
;; or:
;(system* "python" "hello-world.py")
)
\pyMx
(2) use make
(3) use abjad
Example here:
http://abjad.mbrsi.org/for_beginners/abjad_hello_world_in_a_file.html
HTH,
Harm