Is there a way to add the output of sys.stdout.write to a variable? Or is there a better way to do what I am doing in jython:
I have a web address("www.example.com/whateverpage.html") and I want to create a variable which I get my script to click into so the end result must be:
HtmlAnchor[<a href="www.example.com/whateverpage.html">]
I tried using pageAnchor = 'HtmlAnchor[<a href="',PageLink,'">]'
but it didn't work, because it outputs a space between the href and the PageLink variable. So I figured I was smart(which apparently I am far from :-) and used stdout.write to print with the spaces but when I output it in the script it looks perfect but when I try to save it to a variable and then print that variable I get (None, None, None).
The other way I thought of doing this is to use regexpressions to get rid of spaces but I need the space between 'a' and 'href'
I'm sure there is a simple way I'm just not seeing, can anyone give me any pointers.. Thanks!