Invocation problems in python

def get_user_agent ():

user_agent = {
    1: "Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
    2: "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a2) Gecko/20110622 Firefox/6.0a2",
    3: "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7"
}


juzi_headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
        "Cookie": "acw_tc=781bad2415356833875868669e6b598e72ed9130bba25091d49514ad0eb03e; PHPSESSID=743qbg5driv4mmsi2c3gcq5of5",
        "Referer": "http://manage.radar.itjuzi.com/admin/report", "Content-Type": "application/json",
        "X-Requested-With": "XMLHttpRequest"}-sharp-sharp-sharp 

I have defined a method in a py file. There are two variables in the method, one user_agent and one juzi.headers. I can directly from** import get_user_agent this

.
Jun.01,2021

can't you just define it as a class?
class get_user_agent ()
then tune
from xxx import get_user_agent
get_user_agent.user_agent
get_user_agent.juzi_headers

Menu