{"id":242,"date":"2017-07-21T03:16:17","date_gmt":"2017-07-21T02:16:17","guid":{"rendered":"http:\/\/192.168.1.18\/?page_id=242"},"modified":"2018-10-06T23:49:32","modified_gmt":"2018-10-06T22:49:32","slug":"python-code-snippets-system-information","status":"publish","type":"page","link":"http:\/\/www.bulis.co.uk\/?page_id=242","title":{"rendered":"Python: Code Snippets &#8211; System Information"},"content":{"rendered":"<p>This is script displays system information including:<\/p>\n<ul>\n<li>Software<\/li>\n<li>CPU<\/li>\n<li>Memory<\/li>\n<li>Storage<\/li>\n<li>Network<\/li>\n<li>Previous Networks<\/li>\n<li>Network Devices<\/li>\n<\/ul>\n<p>To run this script copy the code below and save to a file called system_info.py<\/p>\n<p>system_info.py:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n#!\/usr\/bin\/env python\r\n\r\nfrom urllib2 import urlopen\r\nfrom collections import namedtuple\r\nfrom subprocess import Popen, PIPE\r\nimport socket\r\nimport fcntl\r\nimport struct\r\nimport platform\r\nimport getpass\r\nimport os\r\nimport sys\r\nimport subprocess\r\n\r\nclass SystemInfo():\r\n\r\n    # ## Software Information ## #\r\n\r\n    # Get hostname\r\n    def get_hostname(self):\r\n        return socket.gethostname()\r\n\r\n    def get_platform_info(self):\r\n        os_platform = platform.platform()\r\n        distname, dist_version, id = platform.linux_distribution()\r\n        system, node, release, version, machine, processor = platform.uname()\r\n        return (os_platform,\r\n                distname,\r\n                dist_version,\r\n                id,\r\n                system,\r\n                node,\r\n                release,\r\n                version,\r\n                machine,\r\n                processor)\r\n\r\n    # Get username\r\n    def get_username(self):\r\n        return getpass.getuser()\r\n\r\n    # Is current user root\r\n    def _is_user_root(self):\r\n        if os.geteuid() == 0:\r\n            return True\r\n        else:\r\n            return False\r\n\r\n    # ## CPU Information ## #\r\n\r\n    # Get CPU info\r\n    def get_cpu_info(self):\r\n        _ntuple_CPUinfo = namedtuple('CPU', 'model hardware revision \\\r\n                                     serial cores temp')\r\n        try:\r\n            return _ntuple_CPUinfo(self.get_cpu_model(),\r\n                                   self.get_cpu_hardware(),\r\n                                   self.get_cpu_revision(),\r\n                                   self.get_cpu_serial(),\r\n                                   self.get_cpu_cores(),\r\n                                   self.get_cpu_temp())\r\n        except:\r\n            return 'Error: Unable to get cpu information :('\r\n\r\n    # Get CPU items\r\n    def _get_cpu_item(self, item, ini_value):\r\n        temp = ini_value\r\n        try:\r\n            f = open('\/proc\/cpuinfo', 'r')\r\n            for line in f:\r\n                if line&#x5B;0:len(item)] == item:\r\n                    item_value = line&#x5B;len(item)+3:]\r\n            f.close()\r\n        except:\r\n            item_value = 'Error: Unable to get %s :(' % item\r\n        return item_value.strip()\r\n\r\n    # Get CPU Serial Number\r\n    def get_cpu_serial(self):\r\n        return self._get_cpu_item('Serial', '0000000000000000')\r\n\r\n    # Get Model Name\r\n    def get_cpu_model(self):\r\n        return self._get_cpu_item('model name', '')\r\n\r\n    # Get Hardware\r\n    def get_cpu_hardware(self):\r\n        return self._get_cpu_item('Hardware', '')\r\n\r\n    # Get Revision\r\n    def get_cpu_revision(self):\r\n        return self._get_cpu_item('Revision', '')\r\n\r\n    # Return CPU temperature as a character string\r\n    def get_cpu_temp(self):\r\n        res = os.popen('vcgencmd measure_temp').readline()\r\n        return(res.replace(&quot;temp=&quot;, &quot;&quot;).replace(&quot;'C\\n&quot;, &quot;&quot;))\r\n\r\n    # Get number of cpu cores\r\n    def get_cpu_cores(self):\r\n        # Linux, Unix and MacOS:\r\n        if hasattr(os, &quot;sysconf&quot;):\r\n            if &quot;SC_NPROCESSORS_ONLN&quot; in os.sysconf_names:\r\n                # Linux and Unix:\r\n                ncpus = os.sysconf(&quot;SC_NPROCESSORS_ONLN&quot;)\r\n                if isinstance(ncpus, int) and ncpus &gt; 0:\r\n                    return ncpus\r\n            else: # OSX:\r\n                return int(os.popen2(&quot;sysctl -n hw.ncpu&quot;)&#x5B;1].read())\r\n\r\n    # ## Hard Disk Informtion ## #\r\n\r\n    # Get Hard Drive Devices\r\n    def get_devices(self, path):\r\n        return next(os.walk(path))&#x5B;1]\r\n\r\n    # Get hard drive usage\r\n    def disk_usage(self, path):\r\n        _ntuple_diskusage = namedtuple('usage', 'path total used free')\r\n        st = os.statvfs(path)\r\n        free = st.f_bavail * st.f_frsize\r\n        total = st.f_blocks * st.f_frsize\r\n        used = (st.f_blocks - st.f_bfree) * st.f_frsize\r\n        return _ntuple_diskusage(path, total, used, free)\r\n\r\n    # Get hard drive(s) info\r\n    def get_disk_info(self):\r\n        devices = &#x5B;]\r\n        for device in self.get_devices(&quot;\/media\/&quot;):\r\n            devices.append(self.disk_usage(&quot;\/media\/&quot; + device + &quot;\/&quot;))\r\n        devices.append(self.disk_usage(&quot;\/root\/&quot;))\r\n        return devices\r\n\r\n    # ## Memory Informtion ## #\r\n\r\n    # Get memory info\r\n    def get_ram_info(self):\r\n        _ntuple_RAMinfo = namedtuple('RAM', 'total used free')\r\n        p = os.popen('free')\r\n        i = 0\r\n        while i &lt; 3:\r\n            i += 1\r\n            line = p.readline()\r\n            if i == 2:\r\n                total = line.split()&#x5B;1]\r\n                used = line.split()&#x5B;2]\r\n                free = int(total) - int(used)\r\n        return _ntuple_RAMinfo(total, used, free)\r\n\r\n    # ## Network Informtion ## #\r\n\r\n    # Get list of network settings\r\n    def get_network_settings(self):\r\n        _ntuple_LANinfo = namedtuple('LAN', 'ssid psk proto')\r\n        ssid = ''\r\n        psk = ''\r\n        proto = ''\r\n        settings = &#x5B;]\r\n        if os.path.exists('\/var\/lib\/connman'):\r\n            for network in next(os.walk('\/var\/lib\/connman'))&#x5B;1]:\r\n                settings.append((network, ''))\r\n                file = open('\/var\/lib\/connman\/%s\/settings' % network, 'r')\r\n                for line in file:\r\n                    settings.append((line&#x5B;:line.find('=')],\r\n                                     line&#x5B;line.find('=')+1:].replace('\\n',\r\n                                     '')))\r\n                file.close()\r\n                settings.append(('', ''))\r\n        elif os.path.exists('\/etc\/wpa_supplicant\/wpa_supplicant.conf'):\r\n            file = open('\/etc\/wpa_supplicant\/wpa_supplicant.conf', 'r')\r\n            for line in file:\r\n                settings.append((line&#x5B;:line.find('=')].strip(),\r\n                                 line&#x5B;line.find('=')+1:].replace('\\n',\r\n                                 '')))\r\n            file.close()\r\n        else:\r\n            return 'Error getting Network Settings!'\r\n        return settings\r\n\r\n    # Get list of networks\r\n    def get_networks_info(self):\r\n        try:\r\n            lst = &#x5B;]\r\n            tabs = ''\r\n            for name, value in self.get_network_settings():\r\n                if name != value:\r\n                    if value != '':\r\n                        if len(name) &lt; 8:\r\n                            tabs = &quot;\\t\\t\\t&quot;\r\n                        elif len(name) &gt; 13:\r\n                            tabs = &quot;\\t&quot;\r\n                        else:\r\n                            tabs = &quot;\\t\\t&quot;\r\n                        lst.append('\\t\\t %s:%s%s\\n' % (name, tabs, value))\r\n                else:\r\n                    lst.append('\\t\\t%s\\n\\n' % name)\r\n            return lst\r\n        except:\r\n            return 'Error getting Networks!'\r\n\r\n    # Get the WAN IP address\r\n    def get_wan_ip_addr(self):\r\n        try:\r\n            return urlopen('http:\/\/ip.42.pl\/raw').read()\r\n        except:\r\n            return 'Error getting WAN IP Address!'\r\n\r\n    # Get LAN IP address for either etho or wlan\r\n    def get_lan_ip_addr(self, ifname):\r\n        try:\r\n            s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\r\n            return socket.inet_ntoa(fcntl.ioctl(\r\n                                    s.fileno(),\r\n                                    0x8915, # SIOCGIFADDR\r\n                                    struct.pack('256s', ifname&#x5B;:15])\r\n                                    )&#x5B;20:24])\r\n        except:\r\n            return 'Error! Unable to get LAN IP address :('\r\n\r\n    # Get default gateway\r\n    def get_default_gateway(self):\r\n        with open(&quot;\/proc\/net\/route&quot;) as fh:\r\n            for line in fh:\r\n                fields = line.strip().split()\r\n                if fields&#x5B;1] != '00000000' or not int(fields&#x5B;3], 16) and 2:\r\n                    continue\r\n                return socket.inet_ntoa(struct.pack(&quot;&lt;L&quot;, int(fields&#x5B;2], 16)))\r\n\r\n    # Get whois response\r\n    def get_whois(self, ip):\r\n        results = &#x5B;]\r\n        if self.is_tool_installed('whois') is False:\r\n            if self._is_user_root():\r\n                self.install_tool('whois')\r\n            else:\r\n                return results\r\n        desc = &#x5B;'netname:', 'descr:', 'country:', 'role:']\r\n        p = os.popen('whois ' + ip)\r\n        for line in p:\r\n            for item in desc:\r\n                if line&#x5B;0:len(item)] == item:\r\n                    results.append(line&#x5B;len(item):].strip())\r\n        return results\r\n\r\n    # Check tool is installed\r\n    def is_tool_installed(self, name):\r\n        try:\r\n            devnull = open(os.devnull)\r\n            subprocess.Popen(&#x5B;name],\r\n                             stdout=devnull,\r\n                             stderr=devnull).communicate()\r\n        except OSError as e:\r\n            if e.errno == os.errno.ENOENT:\r\n                return False\r\n        return True\r\n\r\n    # Install Whois\r\n    def install_tool(self, name):\r\n        os.popen('sudo apt-get install -y -qq %s' % name, 'w', 1)\r\n\r\n    # Discover other devices on the network\r\n    def get_arp_info(self):\r\n        import re\r\n        devices = &#x5B;]\r\n        pid = Popen(&#x5B;&quot;arp&quot;], stdout=PIPE)\r\n        s = pid.communicate()&#x5B;0]\r\n        for item in s.split('\\n'):\r\n            devices.append(&quot;%s&quot; % item.strip())\r\n        return devices\r\n\r\n    # Get complete system information\r\n    def get_system_info(self):\r\n        try:\r\n            root_user = self._is_user_root()\r\n            arp_info = self.get_arp_info()\r\n            cpu_info = self.get_cpu_info()\r\n            disk_info = self.get_disk_info()\r\n            ram_info = self.get_ram_info()\r\n            networks_info = self.get_networks_info()\r\n            whois_info = self.get_whois(self.get_wan_ip_addr())\r\n            disk_info_txt = '\\nStorage:'\r\n            networks_info_txt = ''\r\n            arp_info_txt = '\\nNetwork Devices:\\n'\r\n            if root_user:\r\n                networks_info_txt = '\\nPrevious Networks:\\n'\r\n            hostname = self.get_hostname()\r\n            username = self.get_username()\r\n            (os_platform,\r\n             distname,\r\n             dist_version,\r\n             id,\r\n             system,\r\n             node,\r\n             release,\r\n             version,\r\n             machine,\r\n             processor) = self.get_platform_info()\r\n            for item in disk_info:\r\n                disk_info_txt = disk_info_txt + '\\\r\n                \\n\\t\\t Path:                  %s\\n \\\r\n                Total:                 %sGB\\n \\\r\n                Used:                  %sGB\\n \\\r\n                Free:                  %sGB\\n' % (\r\n                item.path,\r\n                item.total \/ (1024**3),\r\n                item.used \/ (1024**3),\r\n                item.free \/ (1024**3))\r\n\r\n            if root_user:\r\n                for network in networks_info:\r\n                    networks_info_txt = networks_info_txt + network\r\n\r\n            for device in arp_info:\r\n                arp_info_txt = arp_info_txt + '\\t\\t%s\\n' % device\r\n\r\n            return '\\nSoftware:\\n \\\r\n                Username:              %s\\n \\\r\n                Hostname:              %s\\n \\\r\n                Platform:              %s\\n \\\r\n                Distribution:          %s\\n \\\r\n                Dist. Version:         %s\\n \\\r\n                System:                %s\\n \\\r\n                Node:                  %s\\n \\\r\n                Release:               %s\\n \\\r\n                Version:               %s\\n \\\r\n                Machine:               %s\\n \\\r\n                Processor:             %s\\n \\\r\n                \\nCPU:\\n \\\r\n                Model:                 %s\\n \\\r\n                Cores:                 %s\\n \\\r\n                Temp:                  %s\\n \\\r\n                Hardware:              %s\\n \\\r\n                Revision:              %s\\n \\\r\n                Serial number:         %s\\n \\\r\n                \\nMemory:\\n \\\r\n                Total:                 %sMB\\n \\\r\n                Used:                  %sMB\\n \\\r\n                Free:                  %sMB\\n \\\r\n                %s \\\r\n                \\nNetwork:\\n \\\r\n                LAN IP Address:\\n \\\r\n                \\teth0:           %s\\n \\\r\n                \\twlan0:          %s\\n \\\r\n                Gateway IP Address:    %s\\n \\\r\n                WAN IP Address:        %s\\n \\\r\n                Whois:\\n \\\r\n                \\tnetname:        %s\\n \\\r\n                \\trole:           %s\\n \\\r\n                \\tdescr:          %s\\n \\\r\n                \\tcountry:        %s\\n \\\r\n                %s \\\r\n                %s' % (\r\n                username,\r\n                hostname,\r\n                os_platform,\r\n                distname,\r\n                dist_version,\r\n                system,\r\n                node,\r\n                release,\r\n                version,\r\n                machine,\r\n                processor,\r\n                cpu_info.model,\r\n                cpu_info.cores,\r\n                cpu_info.temp,\r\n                cpu_info.hardware,\r\n                cpu_info.revision,\r\n                cpu_info.serial,\r\n                int(ram_info.total) \/ 1024,\r\n                int(ram_info.used) \/ 1024,\r\n                int(ram_info.free) \/ 1024,\r\n                disk_info_txt,\r\n                self.get_lan_ip_addr('eth0'),\r\n                self.get_lan_ip_addr('wlan0'),\r\n                self.get_default_gateway(),\r\n                self.get_wan_ip_addr(),\r\n                whois_info&#x5B;0],\r\n                whois_info&#x5B;3],\r\n                whois_info&#x5B;1],\r\n                whois_info&#x5B;2],\r\n                networks_info_txt,\r\n                arp_info_txt)\r\n        except:\r\n            return 'Error! Unable to get system informtaion :('\r\n\r\n\r\n# Check if running stand-alone or imported\r\nif __name__ == '__main__':\r\n   import system_info\r\n   si = SystemInfo()\r\n   info = si.get_system_info()\r\n   print info\r\n<\/pre>\n<p>Output:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo python system_info.py\r\nSoftware:\r\n             Username:              root\r\n             Hostname:              prb-glow\r\n             Plantform:             Linux-4.9.35+-armv6l-with-debian-8.0\r\n             Distribution:          debian\r\n             Dist. Version:         8.0\r\n             System:                Linux\r\n             Node:                  prb-glow\r\n             Release:               4.9.35+\r\n             Version:               #1014 Fri Jun 30 14:34:49 BST 2017\r\n             Machine:               armv61\r\n             Processor:\r\n\r\nCPU:\r\n             Model:                 ARMv6-compatible processor rev 7 (v61)\r\n             Cores:                 1\r\n             Temp:                  41.2\r\n             Hardware:              BCM2835\r\n             Revision:              9000c1\r\n             Serial Number:         0000000009f23301\r\n\r\nMemory:\r\n             Total:                 370MB\r\n             Used:                  46MB\r\n             Free:                  324MB\r\n\r\nStorage:\r\n             Path:                  \/root\/\r\n             Total:                 7GB\r\n             Used:                  1GB\r\n             Free:                  5GB\r\n\r\nNetwork:\r\n             LAN IP Address:\r\n                    eth0:           Error! Unable to get LAN IP Address : (\r\n                    wlan0:          192.168.1.29\r\n             Gateway IP Address:    192.168.1.1\r\n             WAN IP Address:        82.27.170.62\r\n             Whois:\r\n                    netname:        VMCBBUK\r\n                    role:           Virgin Media Network Management Centre\r\n                    descr:          NORTHFIELDS\r\n                    country:        GB\r\n\r\nPrevious Networks:\r\n             ctrl_interface:        DIR=\/var\/run\/wpa_supplicant GROUP=netdev\r\n             update_config:         1\r\n\r\n\r\n             network                        {\r\n             ssid:                  &quot;PRB WLAN&quot;\r\n             psk:                   &quot;PASSWORD HERE&quot;\r\n             proto:                 WPA2\r\n             key_mgmt:              WPA-PSK\r\n            }\r\n\r\nNetwork Devices:\r\n             Address            HWtype   HWAddress            Flags Mask      Iface\r\n             192.168.1.10       ether    b8:27:eb:5c:57:ff    C               wlan0\r\n             192.168.1.17       ether    00:16:ea:5c:c6:10    C               wlan0\r\n             192.168.1.1        ether    a0:21:b7:23:46:b3    C               wlan0\r\n             192.168.1.11       ether    b8:27:eb:ad:c0:01    C               wlan0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is script displays system information including: Software CPU Memory Storage Network Previous Networks Network Devices To run this script copy the code below and save to a file called system_info.py system_info.py: #!\/usr\/bin\/env python from urllib2 import urlopen from collections import namedtuple from subprocess import Popen, PIPE import socket import fcntl import struct import platform [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":239,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python: Code Snippets - System Information - Phantom Raspberry Blower<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.bulis.co.uk\/?page_id=242\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python: Code Snippets - System Information - Phantom Raspberry Blower\" \/>\n<meta property=\"og:description\" content=\"This is script displays system information including: Software CPU Memory Storage Network Previous Networks Network Devices To run this script copy the code below and save to a file called system_info.py system_info.py: #!\/usr\/bin\/env python from urllib2 import urlopen from collections import namedtuple from subprocess import Popen, PIPE import socket import fcntl import struct import platform [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.bulis.co.uk\/?page_id=242\" \/>\n<meta property=\"og:site_name\" content=\"Phantom Raspberry Blower\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-06T22:49:32+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.bulis.co.uk\/?page_id=242\",\"url\":\"http:\/\/www.bulis.co.uk\/?page_id=242\",\"name\":\"Python: Code Snippets - System Information - Phantom Raspberry Blower\",\"isPartOf\":{\"@id\":\"http:\/\/www.bulis.co.uk\/#website\"},\"datePublished\":\"2017-07-21T02:16:17+00:00\",\"dateModified\":\"2018-10-06T22:49:32+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.bulis.co.uk\/?page_id=242#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.bulis.co.uk\/?page_id=242\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.bulis.co.uk\/?page_id=242#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.bulis.co.uk\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"http:\/\/www.bulis.co.uk\/?page_id=57\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python Tutorials\",\"item\":\"http:\/\/www.bulis.co.uk\/?page_id=73\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Python: Code Snippets\",\"item\":\"http:\/\/www.bulis.co.uk\/?page_id=239\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Python: Code Snippets &#8211; System Information\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.bulis.co.uk\/#website\",\"url\":\"http:\/\/www.bulis.co.uk\/\",\"name\":\"Phantom Raspberry Blower\",\"description\":\"Blowing Raspberrys since 1989\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.bulis.co.uk\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python: Code Snippets - System Information - Phantom Raspberry Blower","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.bulis.co.uk\/?page_id=242","og_locale":"en_GB","og_type":"article","og_title":"Python: Code Snippets - System Information - Phantom Raspberry Blower","og_description":"This is script displays system information including: Software CPU Memory Storage Network Previous Networks Network Devices To run this script copy the code below and save to a file called system_info.py system_info.py: #!\/usr\/bin\/env python from urllib2 import urlopen from collections import namedtuple from subprocess import Popen, PIPE import socket import fcntl import struct import platform [&hellip;]","og_url":"http:\/\/www.bulis.co.uk\/?page_id=242","og_site_name":"Phantom Raspberry Blower","article_modified_time":"2018-10-06T22:49:32+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.bulis.co.uk\/?page_id=242","url":"http:\/\/www.bulis.co.uk\/?page_id=242","name":"Python: Code Snippets - System Information - Phantom Raspberry Blower","isPartOf":{"@id":"http:\/\/www.bulis.co.uk\/#website"},"datePublished":"2017-07-21T02:16:17+00:00","dateModified":"2018-10-06T22:49:32+00:00","breadcrumb":{"@id":"http:\/\/www.bulis.co.uk\/?page_id=242#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.bulis.co.uk\/?page_id=242"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.bulis.co.uk\/?page_id=242#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.bulis.co.uk\/"},{"@type":"ListItem","position":2,"name":"Tutorials","item":"http:\/\/www.bulis.co.uk\/?page_id=57"},{"@type":"ListItem","position":3,"name":"Python Tutorials","item":"http:\/\/www.bulis.co.uk\/?page_id=73"},{"@type":"ListItem","position":4,"name":"Python: Code Snippets","item":"http:\/\/www.bulis.co.uk\/?page_id=239"},{"@type":"ListItem","position":5,"name":"Python: Code Snippets &#8211; System Information"}]},{"@type":"WebSite","@id":"http:\/\/www.bulis.co.uk\/#website","url":"http:\/\/www.bulis.co.uk\/","name":"Phantom Raspberry Blower","description":"Blowing Raspberrys since 1989","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.bulis.co.uk\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/242"}],"collection":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242"}],"version-history":[{"count":0,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/242\/revisions"}],"up":[{"embeddable":true,"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/239"}],"wp:attachment":[{"href":"http:\/\/www.bulis.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}