{
  "attachments": [],
  "comments_archived": true,
  "date": "2005-10-25T16:28:01.000Z",
  "layout": "post",
  "tags": [
    "asides",
    "python",
    "xbox",
    "xbmc",
    "lazyweb"
  ],
  "title": "IPython as networked command shell on XBMC?",
  "wordpress_id": 749,
  "wordpress_slug": "ipython-as-networked-command-shell-on-xbmc",
  "wordpress_url": "http://decafbad.com/blog/?p=749",
  "year": "2005",
  "month": "10",
  "day": "25",
  "isDir": false,
  "slug": "ipython-as-networked-command-shell-on-xbmc",
  "type": "entry",
  "postName": "2005-10-25-ipython-as-networked-command-shell-on-xbmc",
  "html": "<p>Just in case it's already been done, or I don't get around do doing it, hear me oh <a href=\"http://www.lazyweb.org/\">LazyWeb</a>:  </p>\n<p>I want to cobble together a version of <a href=\"http://ipython.scipy.org/\">IPython</a> (or at least an <a href=\"http://docs.python.org/lib/module-code.html\">InteractiveConsole</a>) that runs on a network socket for access via telnet.  I then intend to upload this to my <a href=\"http://decafbad.com/blog/2005/09/26/making-the-xbox-maker-friendly\">XBMC-equipped Xbox</a> and run it as a command shell there for access from my LAN.  It seems like an idea that should work, since XBMC packs a Python install.</p>\n<!-- tags: python xbmc xbox lazyweb -->\n\n<div id=\"comments\" class=\"comments archived-comments\"><h3>Archived Comments</h3>\n<ul class=\"comments\">\n<li class=\"comment\" id=\"comment-221087779\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://edey.org\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=6558a34bd2590143d0e945e7020b49bf&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://edey.org\">mike</a>\n</div>\n\n\n<p><a href=\"#comment-221087779\" class=\"permalink\"><time datetime=\"2005-10-26T02:59:28\">2005-10-26T02:59:28</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>I don't have such a toy to play with but I'm wondering why the question wasn't asked, and answered, with ssh+screen?</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087782\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221087782\" class=\"permalink\"><time datetime=\"2005-10-26T03:36:57\">2005-10-26T03:36:57</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>@Mike: Because XBMC doesn't run ssh+screen, only a Python interpreter embedded in an entertainment center media dashboard. (ie. Not an OS like Linux)</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087784\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://thoughts.keenspace.com/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=adb573897a5fbaeda0d049a803a33c3f&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://thoughts.keenspace.com/\">kaolin fire</a>\n</div>\n\n\n<p><a href=\"#comment-221087784\" class=\"permalink\"><time datetime=\"2005-10-26T06:37:55\">2005-10-26T06:37:55</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>when you say 'like telnet' you mean just opening up port 23 and listening on it and executing said instructions?  I don't know Python (though coincidentally I had to debug some 2-3yo python today; that was interesting), but I presume it makes it not-so-hard to open server sockets and listener sockets, and then execute the dynamic code in a readloop... but then I don't know XBMC beyond the above link you posted, so this is probably just all optimistic hot air. ;)</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087786\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221087786\" class=\"permalink\"><time datetime=\"2005-10-26T10:44:00\">2005-10-26T10:44:00</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>@kaolin: Oh, yeah, I think it would / will be about as easy as that.  I've just been too busy or lazy to have done it yet, and hoped that someone somewhere had already done something whizbangy with a Python shell-on-a-socket.  :)</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087789\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=740b38f7d90076fee1dd8aac4459b354&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"\">Chris</a>\n</div>\n\n\n<p><a href=\"#comment-221087789\" class=\"permalink\"><time datetime=\"2005-10-27T11:50:52\">2005-10-27T11:50:52</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>Perhaps PYRO (Python Remote Objects) is a choice, I might give it a try\non weekend (on my xbox of course). Though I cannot imagine any real use\nso far.</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087792\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=d7875f8cfd8ba9262bfff2bf6f6f9b35&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"\">Itamar Shtull-Trauring</a>\n</div>\n\n\n<p><a href=\"#comment-221087792\" class=\"permalink\"><time datetime=\"2005-10-27T18:02:14\">2005-10-27T18:02:14</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>twisted.conch lets you hook up a python interpreter to a telnet or ssh server (which are implemented in Python, of course).</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087794\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221087794\" class=\"permalink\"><time datetime=\"2005-10-27T19:18:32\">2005-10-27T19:18:32</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>Hmm, it's been a year or so since last I tinkered with Twisted...  It's tempting, since I remember all the nifty toys I played with in that environment-- and an Xbox with XBMC is just the place for it, since it doesn't have a shell or much OS infrastructure.  Though, I was kinda looking for something that used the core Python modules so I didn't have to plunk down a lot of code on the HD.</p>\n<p>On the other hand...  Twisted could let me do a lot of things on that little box without installing Linux.</p></div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221087796\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://highearthorbit.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a25421f6c79d5f381fab65c82abf85e8&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://highearthorbit.com\">Andrew</a>\n</div>\n\n\n<p><a href=\"#comment-221087796\" class=\"permalink\"><time datetime=\"2005-11-13T23:17:37\">2005-11-13T23:17:37</time></a></p>\n</div>\n\n\n<div class=\"content\"><p>What about looking at Nokia's Python btconsole. I run the python script on my phone, and then open a screen to the /dev/tty.NokiaBTSocket and am presented with a console on the phone itself.</p>\n<p>I imagine you could grab the btconsole.py or simplebtconsole.py and set it up on XBMC. Depends on what modules are available.</p>\n<p>I'm running a REALLY old version of XBMP (predecessor/sibling to XMBC) and have happily been running Xebian and MythTV frontend. However, recently came across the MythTV front-end with XMBC as well as all these new features so will upgrading it myself. However, the fiance' doesn't much like me messing with her \"Tivo\".</p></div>\n\n\n</li>\n</ul>\n\n\n</div>\n\n\n",
  "body": "Just in case it's already been done, or I don't get around do doing it, hear me oh [LazyWeb][lw]:  \r\n\r\nI want to cobble together a version of [IPython][ip] (or at least an [InteractiveConsole][ic]) that runs on a network socket for access via telnet.  I then intend to upload this to my [XBMC-equipped Xbox][xb] and run it as a command shell there for access from my LAN.  It seems like an idea that should work, since XBMC packs a Python install.\r\n\r\n[lw]: http://www.lazyweb.org/\r\n[ip]: http://ipython.scipy.org/\r\n[ic]: http://docs.python.org/lib/module-code.html\r\n[xb]: http://decafbad.com/blog/2005/09/26/making-the-xbox-maker-friendly\r\n\r\n<!-- tags: python xbmc xbox lazyweb -->\n\n<div id=\"comments\" class=\"comments archived-comments\">\n            <h3>Archived Comments</h3>\n            \n        <ul class=\"comments\">\n            \n        <li class=\"comment\" id=\"comment-221087779\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"http://edey.org\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=6558a34bd2590143d0e945e7020b49bf&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"http://edey.org\">mike</a>\n                </div>\n                <a href=\"#comment-221087779\" class=\"permalink\"><time datetime=\"2005-10-26T02:59:28\">2005-10-26T02:59:28</time></a>\n            </div>\n            <div class=\"content\"><p>I don't have such a toy to play with but I'm wondering why the question wasn't asked, and answered, with ssh+screen?</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087782\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\n                </div>\n                <a href=\"#comment-221087782\" class=\"permalink\"><time datetime=\"2005-10-26T03:36:57\">2005-10-26T03:36:57</time></a>\n            </div>\n            <div class=\"content\"><p>@Mike: Because XBMC doesn't run ssh+screen, only a Python interpreter embedded in an entertainment center media dashboard. (ie. Not an OS like Linux)</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087784\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"http://thoughts.keenspace.com/\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=adb573897a5fbaeda0d049a803a33c3f&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"http://thoughts.keenspace.com/\">kaolin fire</a>\n                </div>\n                <a href=\"#comment-221087784\" class=\"permalink\"><time datetime=\"2005-10-26T06:37:55\">2005-10-26T06:37:55</time></a>\n            </div>\n            <div class=\"content\"><p>when you say 'like telnet' you mean just opening up port 23 and listening on it and executing said instructions?  I don't know Python (though coincidentally I had to debug some 2-3yo python today; that was interesting), but I presume it makes it not-so-hard to open server sockets and listener sockets, and then execute the dynamic code in a readloop... but then I don't know XBMC beyond the above link you posted, so this is probably just all optimistic hot air. ;)</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087786\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\n                </div>\n                <a href=\"#comment-221087786\" class=\"permalink\"><time datetime=\"2005-10-26T10:44:00\">2005-10-26T10:44:00</time></a>\n            </div>\n            <div class=\"content\"><p>@kaolin: Oh, yeah, I think it would / will be about as easy as that.  I've just been too busy or lazy to have done it yet, and hoped that someone somewhere had already done something whizbangy with a Python shell-on-a-socket.  :)</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087789\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=740b38f7d90076fee1dd8aac4459b354&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"\">Chris</a>\n                </div>\n                <a href=\"#comment-221087789\" class=\"permalink\"><time datetime=\"2005-10-27T11:50:52\">2005-10-27T11:50:52</time></a>\n            </div>\n            <div class=\"content\"><p>Perhaps PYRO (Python Remote Objects) is a choice, I might give it a try\non weekend (on my xbox of course). Though I cannot imagine any real use\nso far.</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087792\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=d7875f8cfd8ba9262bfff2bf6f6f9b35&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"\">Itamar Shtull-Trauring</a>\n                </div>\n                <a href=\"#comment-221087792\" class=\"permalink\"><time datetime=\"2005-10-27T18:02:14\">2005-10-27T18:02:14</time></a>\n            </div>\n            <div class=\"content\"><p>twisted.conch lets you hook up a python interpreter to a telnet or ssh server (which are implemented in Python, of course).</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087794\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2377f34a68801b861c3e54e1301f0dce&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\n                </div>\n                <a href=\"#comment-221087794\" class=\"permalink\"><time datetime=\"2005-10-27T19:18:32\">2005-10-27T19:18:32</time></a>\n            </div>\n            <div class=\"content\"><p>Hmm, it's been a year or so since last I tinkered with Twisted...  It's tempting, since I remember all the nifty toys I played with in that environment-- and an Xbox with XBMC is just the place for it, since it doesn't have a shell or much OS infrastructure.  Though, I was kinda looking for something that used the core Python modules so I didn't have to plunk down a lot of code on the HD.</p>\n\n<p>On the other hand...  Twisted could let me do a lot of things on that little box without installing Linux.</p></div>\n            \n        </li>\n    \n        <li class=\"comment\" id=\"comment-221087796\">\n            <div class=\"meta\">\n                <div class=\"author\">\n                    <a class=\"avatar image\" rel=\"nofollow\" \n                       href=\"http://highearthorbit.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a25421f6c79d5f381fab65c82abf85e8&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\n                    <a class=\"avatar name\" rel=\"nofollow\" \n                       href=\"http://highearthorbit.com\">Andrew</a>\n                </div>\n                <a href=\"#comment-221087796\" class=\"permalink\"><time datetime=\"2005-11-13T23:17:37\">2005-11-13T23:17:37</time></a>\n            </div>\n            <div class=\"content\"><p>What about looking at Nokia's Python btconsole. I run the python script on my phone, and then open a screen to the /dev/tty.NokiaBTSocket and am presented with a console on the phone itself.</p>\n\n<p>I imagine you could grab the btconsole.py or simplebtconsole.py and set it up on XBMC. Depends on what modules are available.</p>\n\n<p>I'm running a REALLY old version of XBMP (predecessor/sibling to XMBC) and have happily been running Xebian and MythTV frontend. However, recently came across the MythTV front-end with XMBC as well as all these new features so will upgrading it myself. However, the fiance' doesn't much like me messing with her \"Tivo\".</p></div>\n            \n        </li>\n    \n        </ul>\n    \n        </div>\n    ",
  "parentPath": "./content/posts/archives/2005",
  "path": "2005/10/25/ipython-as-networked-command-shell-on-xbmc",
  "needsBuild": true,
  "prevPostPath": "2005/10/25/looks-like-i-need-a-new-library-card",
  "prevPostTitle": "Looks like I need a new library card",
  "nextPostPath": "2005/10/25/ipod-go-thud-then-click-click-click",
  "nextPostTitle": "iPod go thud then click, click, click."
}