St.code on multiple lines using for loop with one code block?


How can I use a for loop to create lines of text in a st.code method? For every iteration, I use a st.code(“commands”) to output this, however I want the commands to output into one code block with new lines.

Currently I need this in a code format and not a text_area as I do not want the commands to wrap like how it does in a text_area.

Is this possible? Looking for alternative methods.

Thank you

Join all the lines in a single string and pass it to st.code.

1 Like