I've written some code

```
for i in range(0, b):
    for g in range(1, b+1):
        if i+1==g:
            a = f'''r{g} = {list(df.iloc[i])}<br>'''

```

I want to be able to store this exact code in a variable and be able to print it out/write it to a file (and hopefully be able to convert it into regular code again)

Just to clarify, I want to be able to print that exact piece of code/write that piece of code to a file

Is it possible?

Thanks in advance