<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[12pt]{pylatex}
\usepackage{examples}

\begin{document}

\section*{Using tagged blocks}

The following Python code block contains a matched {\tt\small\verb|pyBeg/pyEnd|} pair, with the tag name {\tt\small info}, to capture the output from the formatted Python {\tt\small print} statements.

\begin{minipage}[t]{0.75\textwidth}
\begin{python}
   import platform, datetime
   # pyBeg(info)
   print("date :      &amp;"+'{:%a %d %b %Y %H:%M:%S}'.format(datetime.datetime.now())+"\\\\")
   print("python :    &amp;"+str(platform.python_version())+"\\\\")
   print("system :    &amp;"+str(platform.system())+"\\\\")
   print("release :   &amp;"+str(platform.release())+"\\\\")
   print("machine :   &amp;"+str(platform.machine())+"\\\\")
   print("processor : &amp;"+str(platform.processor())+"\\\\")
   print("platform :  &amp;"+str(platform.platform()))
   # pyEnd(info)
\end{python}
\end{minipage}
\hskip 1cm
\begin{minipage}[t]{0.25\textwidth}
\begin{latex}
   \bgroup\tt
   \begin{tabular}{rl}
      \py{info}
   \end{tabular}
   \egroup
\end{latex}
\end{minipage}

\vspace{12pt}

Here is the output caught from the above block.

\bgroup\tt
\begin{tabular}{rl}
   \py{info}
\end{tabular}
\egroup

\end{document}
</pre></body></html>