Python: Assign print output to a variable
I really hate to be asking two questions twice in one day, but I could not find an answer anywhere else. I would like to know how to assign the output of the <code>print</code> function (or any function) to a variable. To give an example:
<code>
import eyeD3 |
    tag = eyeD3.Tag() |
    tag.link("/some/file.mp3") |
    print tag.getArtist()
</code>

How do I assign the output of <code>print tag.getArtist</code> to a variable?
Python: Assign print output to a variable
===

I really hate to be asking two questions twice in one day, but I could not find an answer anywhere else. I would like to know how to assign the output of the <code>print</code> function (or any function) to a variable. To give an example:
<code>
import eyeD3 |
    tag = eyeD3.Tag() |
    tag.link("/some/file.mp3") |
    print tag.getArtist()
</code>

How do I assign the output of <code>print tag.getArtist</code> to a variable?