In [1]:
import requests

In [2]:
def print_foo():
    
    r = requests.get('https://google.com')
    r.text    
    return r.text

In [3]:
class Environment:

    def get_state(self, msg):
        print('msg = %s' % msg)

In [4]:
class Bar:
    
    def more_info(self, env):
        msg = print_foo()[0:80]
        print(msg)
        env.get_state(msg)

In [5]:
env = Environment()
b = Bar()
b.more_info(env)


<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="fr"
msg = <!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="fr"

In [ ]: