Send string to and from raspberry pi

So how do I change that variable from being a function variable to a global variable?