• use it in a sagesilent block where needed,
• cleanly typeset in the appendix via lstinputlisting or minted.
It is not a perfect solution (the typesetting parameters used by minted or lstinputlisting need to be tweaked to get something "close to" the result of sageblock, but the consistency and ease of use are obtained : there is a single source for both the paper and the associated computations.