Hi Wolfgang,
Why in the first example, the indentation of my Python code that I wish is not respected and that I have to do as the second example to have what I want ?
Thank you.
Fabrice

 \defineframedtext
     [algorithmframe]
     [width=fit,
      location=middle,
 foregroundstyle={\tt\switchtobodyfont[11pt]},
      framecolor=darkblue,
      corner=round]

  \definelines
     [algorithm]
     [space=on,
      before=\startalgorithmframe,
      after=\stopalgorithmframe]

\starttext
\startlinecorrection[blank]
  \startmidaligned
    \startalgorithm
      {\blue def nom} (argument1, argument2,\unknown):
     \unknown
    {\orange return} résultat
    \stopalgorithm
  \stopmidaligned
\stoplinecorrection
\startlinecorrection[blank]
  \startmidaligned
    \startalgorithm
{\blue def nom} (argument1, argument2,\unknown):
     \unknown
    {\orange return} résultat
    \stopalgorithm
  \stopmidaligned
\stoplinecorrection
\stoptext