This might be a silly question but:
When you append a given string to a QTextBrowser object, can you make it a link to a signal to a function that takes its text and does something with it? All I need is for it to save the text to a variable actually.
As in, can a link lead to a function instead of to a website.
It certainly is possible.
Here is a code example:
Any link that has a url that begins with "some_special_identifier://" will be picked up and the text after that will be used to look up and call a function of the same name. Please note that this could be a little risky as there is the potential for all sorts of functions to be called that perhaps you don't intend, if the user has any control over what is displayed in the TextBrowser. It might be better to only allow certain functions to be run, and perhaps only at certain times. That is of course up to you to enforce!
P.S. my code is written for Python 2.7 (I see you are using Python 3). So I think you will need to change
print 'text'
toprint('text')
at the very least!