Python | Не работает код который должен выводить данные в консоль

Тут показано что я вводил

Что делать, в консоли программа по вічислению айпи работает, а вот когда я tkinter подключил, точнее внедрил в окно оно вывело ошибку................

Код:

import tkinter
from tkinter import Tk
from tkinter import *
import os
from click import style
clear = '                                                                                                                        '
root = Tk()
root.geometry("1290x720")
root['bg'] = 'black'
class gg():
    bg = 'black'
    fg = 'green'
version = Label(root, text = 'Version: 1.0.0', bg = 'black', fg = 'green').place(relx=0, rely=0.950)



def text():
    cmd = message.get()
    if cmd == 'ip':
        def info():
            import requests 
            import time 
            import json
            srip = ip.get()
            response = requests.get(f'http://ipinfo.io/{ srip }/json' )         
            print(ip)
            user_ip = response.json()[ 'ip' ] 
            user_city = response.json()[ 'city' ]  
            user_region = response.json()[ 'region' ] 
            user_country = response.json()[ 'country' ]  
            user_location = response.json()[ 'loc' ]  
            user_org = response.json()[ 'org' ]  
            user_timezone = response.json()[ 'timezone' ] 
            os.system('clear')
            all_info = f'Fore.RED + \n<Info>\nIP : { user_ip }\nСити : { user_city }\nРегион : { user_region }\nСтрана : { user_country }\nЛокация : { user_location }\nОгранизация : { user_org }\nЗона : { user_timezone }' 
        print( all_info )
        ip = ''
        iplog = Entry(textvariable=ip, width=25, bg = 'white', fg = 'red', relief='flat').place(relx=0, rely = 0.4)
        ip = StringVar()
        btnEnterip = Button(text = '[+] Ip ↵', bg = 'black', fg = 'red',command=info, relief='flat').place(relx=0.13, rely = 0.4)
        
logo = Label(root, text = 'Terminal L1meek', bg = 'black', fg = 'red').place(relx=0, rely=0.929)
telegram = Label(root, text = 'Telegram: @L1meek', bg = 'black', fg = 'red').place(relx=0.2, rely=0.929)
st1 = '1.'
str1 = Label(root, text = st1, bg = 'black', fg = 'red').place(relx=0)
st2 = '2.'
str2 = Label(root, text = st2, bg = 'black', fg = 'red').place(relx=0, rely=0.03)
st3 = '3.'
str3 = Label(root, text = st3, bg = 'black', fg = 'red').place(relx=0, rely=0.06)
st4 = '4.'
str4 = Label(root, text = st4, bg = 'black', fg = 'red').place(relx=0, rely=0.09)
st5 = '5.'
str5 = Label(root, text = st5, bg = 'black', fg = 'red').place(relx=0, rely=0.12)
st6 = '6.'
str6 = Label(root, text = st6, bg = 'black', fg = 'red').place(relx=0, rely=0.15)
st7 = '7.'
str7 = Label(root, text = st7, bg = 'black', fg = 'red').place(relx=0, rely=0.18)
st8 = '8.'
str8 = Label(root, text = st8, bg = 'black', fg = 'red').place(relx=0, rely=0.21)
st9 = '9.'
str9 = Label(root, text = st9, bg = 'black', fg = 'red').place(relx=0, rely=0.24)
st10 = '10.'
str10 = Label(root, text = st10, bg = 'black', fg = 'red').place(relx=0, rely=0.27)
st11 = '11.'
str11 = Label(root, text = st11, bg = 'black', fg = 'red').place(relx=0, rely=0.30)
st12 = '12.'
str12 = Label(root, text = st12, bg = 'black', fg = 'red').place(relx=0, rely=0.33)

btnEnter = Button(text = '↵', bg = 'black', fg = 'red',command=text, relief='flat').place(relx=0.13, rely = 0.37)
message = StringVar()
cmd = Entry(textvariable=message, width=25, bg = 'white', fg = 'red', relief='flat').place(relx=0, rely = 0.37)
root.bind('Enter', text())#Этот бинд тоже почему то не работает
root.mainloop()

Ошибка(чтобы её получить введите в первое поле ip, нажмите кнопку рядом с ним, появится второе вбейте туда к примеру 8.8.8.8, и нажмите кнопку рядом с ним, программа должна просто выводить данные в консоль!):

PY_VAR1
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\ilyas\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\ilyas\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\ilyas\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\ilyas\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ilyas\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1921, in __call__
    return self.func(*args)
  File "e:\VSC\pyvsc\pygame\main.py", line 27, in info
    user_ip = response.json()[ 'ip' ]
  File "C:\Users\ilyas\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 917, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value] <!DOCTYPE html>
<html>
<head>
    <title>404: Page Not Found - IPinfo.io</title>
    <meta charset="utf-8">
    <meta name="apple-itunes-app" content="app-id=917634022">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
    <meta name="description" content="">

    <link rel="manifest" href="/static/manifest.json">
    <link rel="icon" sizes="48x48" href="/static/deviceicons/android-icon-48x48.png">
    <link rel="icon" sizes="96x96" href="/static/deviceicons/android-icon-96x96.png">
    <link rel="icon" sizes="192x192" href="/static/deviceicons/android-icon-192x192.png">
    <link rel="apple-touch-icon-precomposed" href="/static/deviceicons/apple-icon-precomposed.png">
    <link type="image/x-icon" href="/static/favicon-96x96.png?v3" rel="shortcut icon">

    <meta property="twitter:card" content="summary_large_image" />
    <meta property="twitter:site" content="@ipinfoio" />
    <link rel="canonical" href="https://ipinfo.io//json">

    <meta property="twitter:title" content="404: Page Not Found - IPInfo.io" />
    <meta property="twitter:description" content="We're the trusted source for IP address information, handling 20 billion IP geolocation API requests per month for over 1,000 businesses and 100,000+ developers" />
    <meta property="twitter:image" content="https://ipinfo.io/static/images/social-images/generic.jpg" />
    <meta property="og:type" content="website" />
    <meta property="og:image" content="https://ipinfo.io/static/images/social-images/generic.jpg" />

    <script>dataLayer = window.dataLayer || [];</script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KT5KQLB');</script>
<!-- End Google Tag Manager -->

<script>
    fetch('https://www.googletagmanager.com/gtm.js?id=GTM-KT5KQLB')
        .then((r) => {
            fetch(`/rt?r=${r.status}&u=${encodeURIComponent(window.location.href)}`)
        })
        .catch((r) => {
            fetch(`/rt?r=err&u=${encodeURIComponent(window.location.href)}`)
        });
</script>


    <link rel="preconnect" href="https://use.typekit.net" crossorigin />
    <link rel="preload" as="style" href="https://use.typekit.net/qls3unz.css" />
    <link rel="stylesheet" href="https://use.typekit.net/qls3unz.css" media="print" onload="this.media='all'" />
    <noscript>
        <link rel="stylesheet" href="https://use.typekit.net/qls3unz.css" />
    </noscript>
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" />

    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" media="print" onload="this.media='all'" />
    <noscript>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" />
    </noscript>
    <link rel="stylesheet" href="https://cdn.ipinfo.io/static/dist/fast.css">


</head>

<body >

    <header>
        <nav class="navbar navbar-expand-md">
            <div class="container position-relative">
                <a class="navbar-brand" href="/"><img src="https://cdn.ipinfo.io/static/images/layout/logo.svg" alt="IPinfo - Comprehensive IP address data, IP geolocation API and database"></a>
                <button class="navbar-toggler collapsed"
type="button" data-toggle="collapse" data-target="#navbarMenu" aria-controls="navbarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse flex-grow-0" id="navbarMenu">

                    <ul class="navbar-nav align-items-stretch order-1 order-lg-2 d-md-none my-4 my-sm-2  d-xl-flex ">
                        <li class="nav-item mr-0 mr-md-3">
                            <a class="btn btn-white btn-block mb-2 mb-xl-0" href="/account/login">Login</a>
                        </li>
                        <li class="nav-item">
                            <a class="btn btn-primary btn-block" href="/signup">Sign up</a>
                        </li>
                    </ul>


                    <ul class="navbar-nav navbar-nav-main order-2 order-lg-1">
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownProducts" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Products</a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownProducts">
                                <ul>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/ip-geolocation-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/geolocation-small.svg" alt="Geolocation" /></a></div>
                                        <div><h6><a href="/products/ip-geolocation-api">IP to Geolocation API</a></h6>
                                        <p><a href="/products/ip-geolocation-api">Customize user experiences</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/ranges-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/ranges-small.svg" alt="IP ranges" /></a></div>
                                        <div><h6><a href="/products/ranges-api">IP Ranges API</a></h6>
                                        <p><a href="/products/ranges-api">Target specific IP ranges</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/proxy-vpn-detection-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/privacy-small.svg" alt="Privacy detection" /></a></div>
                                        <div><h6><a href="/products/proxy-vpn-detection-api">Privacy Detection API</a></h6>
                                        <p><a href="/products/proxy-vpn-detection-api">Unmask users' identities</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/ip-company-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/company-small.svg" alt="Company" /></a></div>
                                        <div><h6><a href="/products/ip-company-api">IP to Company API</a></h6>
                                        <p><a href="/products/ip-company-api">Leverage anonymous leads</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/asn-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/asn-small.svg" alt="ASN" /></a></div>
                                        <div><h6><a href="/products/asn-api">ASN API</a></h6>
                                        <p><a href="/products/asn-api">Improve data enrichment</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/reverse-ip-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/domains-small.svg" alt="Domains" /></a></div>
                                        <div><h6><a href="/products/reverse-ip-api">Hosted Domains API</a></h6>
                                        <p><a href="/products/reverse-ip-api">Enhance lead generation</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/ip-carrier-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/carrier-small.svg" alt="Geolocation" /></a></div>
                                        <div><h6><a href="/products/ip-carrier-api">IP to Mobile Carrier API</a></h6>
                                        <p><a href="/products/ip-carrier-api">Identify mobile users</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center">
                                        <div class="pr-2"><a href="/products/ip-abuse-contact-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/abuse-small.svg" alt="Abuse contact" /></a></div>
                                        <div><h6><a href="/products/ip-abuse-contact-api">Abuse Contact API</a></h6>
                                        <p><a href="/products/ip-abuse-contact-api">Automate abusive IP reporting</a></p></div>
                                    </li>
                                    <li class="d-flex align-items-center mb-sm-0">
                                        <div class="pr-2"><a href="/products/whois-api"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/whois-small.svg" alt="Database download" /></a></div>
                                        <div><h6><a href="/products/whois-api">IP Whois API</a></h6>
                                        <p><a href="/products/whois-api">Get more IP insights</a></p></div>
                                    </li>
                                </ul>
                                <div class="d-flex align-items-center mb-sm-0 db-menu">
                                    <div class="pr-2"><a
href="/products/ip-database-download"><img class="p-icon" src="https://cdn.ipinfo.io/static/images/product-icons/database-download-small.svg" alt="Database download" /></a></div>
                                    <div><h6><a href="/products/ip-database-download">IP Database Download</a></h6>
                                    <p><a href="/products/ip-database-download">Access data the way you choose</a></p></div>
                                </div>

                            </div>
                        </li>
                        <li class="nav-item dropdown position-static">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownSolutions" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Solutions</a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownSolutions">
                                <ul>
                                    <li>
                                        <ul>
                                            <li>
                                                <h5><a href="/enterprise">Enterprise</a></h5>
                                                <p><a href="/enterprise">Customized features for fast-moving organizations</a></p>
                                            </li>
                                            <li>
                                                <h5><a href="/integrations">Integrations</a></h5>
                                                <p><a href="/integrations">Enhance your IP address insights</a></p>
                                            </li>
                                        </ul>
                                    </li>
                                    <li>
                                        <h5 class="mb-3"><a href="/use-cases">Use cases</a></h5>
                                        <ul>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-ecommerce">E-commerce</a></h6>

                                                <p><a href="/use-cases/ip-data-for-ecommerce">Personalize every customer experience</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-fintech">Financial Technology</a></h6>
                                                <p><a href="/use-cases/ip-data-for-fintech">Secure transactions for local and global users</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-advertising">Advertising Technology</a></h6>
                                                <p><a href="/use-cases/ip-data-for-advertising">Reach the right people with the right message</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/cybersecurity">Cyber Security</a></h6>
                                                <p><a href="/use-cases/cybersecurity">Stay a step ahead of hidden
identities</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-telecom-companies">Telecommunication</a></h6>
                                                <p><a href="/use-cases/ip-data-for-telecom-companies">Provide reliable communication and connectivity</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-abm">Account Based Marketing</a></h6>
                                                <p><a href="/use-cases/ip-data-for-abm">Deanonymize B2B traffic at scale</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-based-website-customization">Web Personalization</a></h6>
                                                <p><a href="/use-cases/ip-based-website-customization">Customize experiences for each user</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-governments">Governments and Institutions</a></h6>
                                                <p><a href="/use-cases/ip-data-for-governments">Bolster cyber defenses and enhance citizens’ lives</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-gametech">GameTech</a></h6>
                                                <p><a href="/use-cases/ip-data-for-gametech">Create better gaming
experiences</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-traveltech">TravelTech</a></h6>
                                                <p><a href="/use-cases/ip-data-for-traveltech">Hassle free experiences for travel</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-data-enrichment">Data Enrichment</a></h6>
                                                <p><a href="/use-cases/ip-data-for-data-enrichment">Enrich data using anonymous web traffic</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-digital-media-entertainment">Digital Media and Entertainment</a></h6>
                                                <p><a href="/use-cases/ip-data-for-digital-media-entertainment">Protect and promote digital content</a></p>
                                            </li>
                                            <li>
                                                <h6><a href="/use-cases/ip-data-for-fraud-prevention">Fraud Prevention</a></h6>
                                                <p><a href="/use-cases/ip-data-for-fraud-prevention">Improve fraud risk modeling</a></p>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownWhyIPinfo" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Why IPinfo?</a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownWhyIPinfo">
                                <ul>
                                    <li>
                                        <ul>
                                            <li>
                                                <h5><a href="/about">About us</a></h5>
                                                <p><a href="/about">How we became the most reliable, accurate, and in-depth source of IP address data</a></p>
                                            </li>
                                        </ul>
                                    </li>
                                    <li>
                                        <ul>
                                            <li>
                                                <h5><a href="/customers">Customer stories</a></h5>
                                                <p><a href="/customers">How future-oriented companies use IPinfo to reach their goals</a></p>
                                            </li>
                                            <li>
                                                <h5><a href="/ip-data">Data</a></h5>
                                                <p><a href="/ip-data">How we deliver the most accurate IP datasets</a></p>
                                            </li>
                                            <li>
                                                <h5><a href="/integrations">Partners</a></h5>
                                                <p><a href="/integrations">How we collaborate with others to bring you the most accurate data on the market</a></p>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="/pricing">Pricing</a>
                        </li>
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownResources" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Resources</a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownResources">
                                <ul>
                                  <li>
                                        <ul>
                                            <li>
                                                <h5><a href="/developers">Documentation</a></h5>
                                                <p><a href="/developers">Explore our API documentation and libraries</a></p>
                                            </li>...

Я сократил ошибку, лиж бы ответ поместился, кстати я делал данную программу просто в консоли и она работала._.[Код рабочей версии][2] Вывод рабочей программы


Ответы (0 шт):