Thinking about some of these discussions, I decided to explore building a Python console app, available as a web page. No sandboxing; it's intended to be run on localhost. It's still pretty rough and doesn't have a ton of neat features. The file management is pretty weak, and doctesting is just stubbed out. Anyway, you can get it with: easy_install HTConsole Then run "htconsole" and a web page should pop up for your interactive pleasure. The ideal is to make Python objects live and editable through the web page. For instance, if you define a function it will be listed with its body in the web page, and you can edit the function in place. Unfortunately it's easy to run out of room, so I might have to explore other ways of displaying information. Also, there's a bunch of problems I've had -- like how to get the body of functions, and how (if it is possible at all) to update a function in place, just to start with. But anyway, with some imagination maybe you can see what's interesting about it, and maybe point out directions for further work that might be more fruitful from your own perspective. -- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
On 4/26/06, Ian Bicking <ianb@colorstudy.com> wrote:
Thinking about some of these discussions, I decided to explore building a Python console app, available as a web page. No sandboxing; it's intended to be run on localhost.
It's still pretty rough and doesn't have a ton of neat features. The file management is pretty weak, and doctesting is just stubbed out.
Anyway, you can get it with:
easy_install HTConsole
I'd really like to get it to work so as to try, but I haven't been able to. Here's what I did, followed by the (complete) error message. ============= For those (like me) who don't have easy_install, you apparently find it at: http://peak.telecommunity.com/DevCenter/EasyInstall If the default location is not on your path, you need to change directory to where it is found. (that's the case for me). Then, doing as Ian suggested: C:\Python24\Scripts>easy_install HTConsole Searching for HTConsole Reading http://www.python.org/pypi/HTConsole/ Best match: HTConsole 0.1 Downloading http://cheeseshop.python.org/packages/2.4/H/HTConsole/HTConsole-0.1- py2.4.egg#md5=99c85b1876a359f2e10c23df6bd63eb1 Processing HTConsole-0.1-py2.4.egg creating c:\python24\lib\site-packages\HTConsole-0.1-py2.4.egg Extracting HTConsole-0.1-py2.4.egg to c:\python24\lib\site-packages Adding HTConsole 0.1 to easy-install.pth file Installing htconsole-script.py script to C:\Python24\Scripts Installing htconsole.exe script to C:\Python24\Scripts Installed c:\python24\lib\site-packages\htconsole-0.1-py2.4.egg Processing dependencies for HTConsole Searching for Paste Reading http://www.python.org/pypi/Paste/ Reading http://pythonpaste.org Best match: Paste 0.9 Downloading http://cheeseshop.python.org/packages/2.4/P/Paste/Paste-0.9-py2.4.eg g#md5=0cc8f68bb84b5f4efb587cb1bfc5a4a9 Processing Paste-0.9-py2.4.egg creating c:\python24\lib\site-packages\Paste-0.9-py2.4.egg Extracting Paste-0.9-py2.4.egg to c:\python24\lib\site-packages Adding Paste 0.9 to easy-install.pth file Installed c:\python24\lib\site-packages\paste-0.9-py2.4.egg Searching for WebHelpers Reading http://www.python.org/pypi/WebHelpers/ Reading http://pylonshq.com/WebHelpers/ Best match: WebHelpers 0.1 Downloading http://cheeseshop.python.org/packages/2.4/W/WebHelpers/WebHelpers-0. 1-py2.4.egg#md5=6c945cc1169f5dc440f1a00352b0796a Processing WebHelpers-0.1-py2.4.egg creating c:\python24\lib\site-packages\WebHelpers-0.1-py2.4.egg Extracting WebHelpers-0.1-py2.4.egg to c:\python24\lib\site-packages Adding WebHelpers 0.1 to easy-install.pth file Installed c:\python24\lib\site-packages\webhelpers-0.1-py2.4.egg Searching for RuleDispatch Reading http://www.python.org/pypi/RuleDispatch/ Couldn't find index page for 'RuleDispatch' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://www.python.org/pypi/ No local packages or download links found for RuleDispatch error: Could not find suitable distribution for Requirement.parse('RuleDispatch' ) ############################# Ok, I got an error message. Still, let's try, keeping my fingers crossed ;-)
Then run "htconsole" and a web page should pop up for your interactive pleasure. The ideal is to make Python objects live and editable through the web page. For instance, if you define a function it will be listed with its body in the web page, and you can edit the function in place.
C:\Python24\Scripts>htconsole Traceback (most recent call last): File "C:\Python24\Scripts\htconsole-script.py", line 5, in ? from pkg_resources import load_entry_point File "c:\python24\lib\site-packages\setuptools-0.6a11-py2.4.egg\pkg_resources. py", line 2438, in ? working_set.require(__requires__) File "c:\python24\lib\site-packages\setuptools-0.6a11-py2.4.egg\pkg_resources. py", line 585, in require needed = self.resolve(parse_requirements(requirements)) File "c:\python24\lib\site-packages\setuptools-0.6a11-py2.4.egg\pkg_resources. py", line 483, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: RuleDispatch ################## Any idea? André
[snip]
Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
Andre Roberge wrote:
On 4/26/06, Ian Bicking <ianb@colorstudy.com> wrote:
Thinking about some of these discussions, I decided to explore building a Python console app, available as a web page. No sandboxing; it's intended to be run on localhost.
It's still pretty rough and doesn't have a ton of neat features. The file management is pretty weak, and doctesting is just stubbed out.
Anyway, you can get it with:
easy_install HTConsole
I'd really like to get it to work so as to try, but I haven't been able to. Here's what I did, followed by the (complete) error message.
============= For those (like me) who don't have easy_install, you apparently find it at: http://peak.telecommunity.com/DevCenter/EasyInstall
Yes, indeed, forgot to mention that. I forgot that RuleDispatch isn't in PyPI. Use: easy_install -f http://peak.telecommunity.com/snapshots/ HTConsole This tells it where to look for RuleDispatch. -- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
On 4/26/06, Ian Bicking <ianb@colorstudy.com> wrote:
Andre Roberge wrote:
On 4/26/06, Ian Bicking <ianb@colorstudy.com> wrote:
Thinking about some of these discussions, I decided to explore building a Python console app, available as a web page. No sandboxing; it's intended to be run on localhost.
It's still pretty rough and doesn't have a ton of neat features. The file management is pretty weak, and doctesting is just stubbed out.
Anyway, you can get it with:
easy_install HTConsole
I'd really like to get it to work so as to try, but I haven't been able to. Here's what I did, followed by the (complete) error message.
============= For those (like me) who don't have easy_install, you apparently find it at: http://peak.telecommunity.com/DevCenter/EasyInstall
Yes, indeed, forgot to mention that. I forgot that RuleDispatch isn't in PyPI. Use:
easy_install -f http://peak.telecommunity.com/snapshots/ HTConsole
This tells it where to look for RuleDispatch.
Good news: this installed it properly. Bad news: it does not work here. It starts Firefox (my default browser) at the http://localhost:8001/ page, which then displays a server error. I've appended below the entire error message from the console. Unfortunately, I must quit for the night. André ============== C:\Python24\Scripts>htconsole C:\Python24\lib\site-packages\wareweb-0.1-py2.4.egg\wareweb\wsgiapp.py:58: Depre cationWarning: httpexceptions.middleware is deprecated; use make_middleware or H TTPExceptionHandler instead Serving from: http://localhost:8001 Error - exceptions.TypeError: unbound method compile() must be called with Templ ate instance as first argument (got nothing instead) URL: http://localhost:8001/ File 'c:\\python24\\lib\\site-packages\\Paste-0.9-py2.4.egg\\paste\\exceptions\\ errormiddleware.py', line 138 in __call__ app_iter = self.application(environ, detect_start_response) File 'c:\\python24\\lib\\site-packages\\Paste-0.9-py2.4.egg\\paste\\httpexceptio ns.py', line 619 in __call__ self.send_http_response, catch=HTTPException) File 'c:\\python24\\lib\\site-packages\\Paste-0.9-py2.4.egg\\paste\\wsgilib.py', line 112 in catch_errors_app app_iter = application(environ, start_response) File 'c:\\python24\\lib\\site-packages\\Paste-0.9-py2.4.egg\\paste\\session.py', line 52 in __call__ app_iter = self.application(environ, session_start_response) File 'c:\\python24\\lib\\site-packages\\Paste-0.9-py2.4.egg\\paste\\recursive.py ', line 54 in __call__ return self.application(environ, start_response) File 'c:\\python24\\lib\\site-packages\\PasteDeploy-0.5-py2.4.egg\\paste\\deploy \\config.py', line 157 in __call__ app_iter = self.application(environ, start_response) File 'c:\\python24\\lib\\site-packages\\Paste-0.9-py2.4.egg\\paste\\urlparser.py ', line 173 in __call__ return application(environ, start_response) File 'C:\\Python24\\lib\\site-packages\\wareweb-0.1-py2.4.egg\\wareweb\\servlet. py', line 42 in __call__ File 'C:\\Python24\\lib\\site-packages\\wareweb-0.1-py2.4.egg\\wareweb\\servlet. py', line 85 in _process File 'C:\\Python24\\lib\\site-packages\\wareweb-0.1-py2.4.egg\\wareweb\\event.py ', line 19 in replacement_func File 'C:\\Python24\\lib\\site-packages\\wareweb-0.1-py2.4.egg\\wareweb\\servlet. py', line 102 in run File 'C:\\Python24\\lib\\site-packages\\wareweb-0.1-py2.4.egg\\wareweb\\event.py ', line 19 in replacement_func File 'c:\\python24\\lib\\site-packages\\HTConsole-0.1-py2.4.egg\\htconsole\\site page.py', line 34 in respond standard_template = Template.compile(file=base_filename) exceptions.TypeError: unbound method compile() must be called with Template inst ance as first argument (got nothing instead) CGI Variables ------------- HTTP_ACCEPT: 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,t ext/plain;q=0.8,image/png,*/*;q=0.5' HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' HTTP_ACCEPT_ENCODING: 'gzip,deflate' HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5' HTTP_CONNECTION: 'keep-alive' HTTP_HOST: 'localhost:8001' HTTP_KEEP_ALIVE: '300' HTTP_USER_AGENT: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2' REMOTE_ADDR: '127.0.0.1' REMOTE_HOST: 'localhost' REQUEST_METHOD: 'GET' SCRIPT_NAME: '/' SERVER_NAME: '127.0.0.1' SERVER_PORT: '8001' SERVER_PROTOCOL: 'HTTP/1.1' Configuration ------------- doctest_dir: './doctests/' root_path: 'C:\\Python24\\lib\\site-packages\\htconsole-0.1-py2.4.egg\\htconso le' save_dir: './python/' WSGI Variables -------------- application: <paste.httpexceptions.HTTPExceptionHandler instance at 0x00DC6B70
htconsole.base_url: '' paste.expected_exceptions: [<class paste.httpexceptions.HTTPException at 0x00B A65D0>] paste.httpexceptions: <paste.httpexceptions.HTTPExceptionHandler instance at 0 x00DC6B70> paste.recursive.forward: <paste.recursive.Forwarder from /> paste.recursive.include: <paste.recursive.Includer from /> paste.recursive.script_name: '' paste.session.factory: <paste.session.SessionFactory object at 0x00DB4ED0> paste.throw_errors: True paste.urlparser.base_python_name: 'htconsole.web' wsgi process: 'Multithread CGI (?)' ------------------------------------------------------------
-- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
Andre Roberge wrote:
Good news: this installed it properly.
Bad news: it does not work here. It starts Firefox (my default browser) at the http://localhost:8001/ page, which then displays a server error. I've appended below the entire error message from the console. Unfortunately, I must quit for the night.
I really should have tested that install. In this case it needed Cheetah 2.0, but you got 1.0. I updated those and added some more links and tested it out, so now just "easy_install htconsole" really should work (as of version 0.1.1). Well, unless you don't have a recent version of setuptools. For people who don't have that, grab this file: http://peak.telecommunity.com/dist/ez_setup.py Run that, which will install the newest version of easy_install, run "easy_install htconsole" and you should be good to go. -- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
On 4/27/06, Ian Bicking <ianb@colorstudy.com> wrote: [snip]
I really should have tested that install. In this case it needed Cheetah 2.0, but you got 1.0. I updated those and added some more links and tested it out, so now just "easy_install htconsole" really should work (as of version 0.1.1).
[snip]
Run that, which will install the newest version of easy_install, run "easy_install htconsole" and you should be good to go.
I had to do easy_install --upgrade htconsole and it worked (the second time; I had a connection refused the first.) It is very nice!! The interface needs a little be of getting used to for multi-line definitions but it's certainly a good basis to build from. Nice work, Ian!
-- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
Dear Ian, I installed easy_install successfully and then I have this session, ending in an error: C:\Python24>easy_install htconsole Searching for htconsole Best match: htconsole 0.2 Processing htconsole-0.2-py2.4.egg htconsole 0.2 is already the active version in easy-install.pth Installing htconsole-script.py script to C:\Python24\Scripts Installing htconsole.exe script to C:\Python24\Scripts Using c:\python24\lib\site-packages\htconsole-0.2-py2.4.egg Processing dependencies for htconsole Searching for Cheetah>=2a Best match: Cheetah 2.0rc6 Downloading http://69.9.164.2/sourceforge/cheetahtemplate/Cheetah-2.0rc6.tar.gz error: Download error: (10061, 'Connection refused') Andy Harrington Ian Bicking wrote:
Andre Roberge wrote:
Good news: this installed it properly.
Bad news: it does not work here. It starts Firefox (my default browser) at the http://localhost:8001/ page, which then displays a server error. I've appended below the entire error message from the console. Unfortunately, I must quit for the night.
I really should have tested that install. In this case it needed Cheetah 2.0, but you got 1.0. I updated those and added some more links and tested it out, so now just "easy_install htconsole" really should work (as of version 0.1.1).
Well, unless you don't have a recent version of setuptools. For people who don't have that, grab this file:
http://peak.telecommunity.com/dist/ez_setup.py
Run that, which will install the newest version of easy_install, run "easy_install htconsole" and you should be good to go.
-- Andrew N. Harrington Computer Science Department Undergraduate Program Director Loyola University Chicago http://www.cs.luc.edu/~anh 512B Lewis Towers (office) Office Phone: 312-915-7982 Snail mail to Lewis Towers 416 Dept. Fax: 312-915-7998 820 North Michigan Avenue aharrin@luc.edu Chicago, Illinois 60611
Andrew Harrington wrote:
Dear Ian, I installed easy_install successfully and then I have this session, ending in an error:
C:\Python24>easy_install htconsole Searching for htconsole Best match: htconsole 0.2 Processing htconsole-0.2-py2.4.egg htconsole 0.2 is already the active version in easy-install.pth Installing htconsole-script.py script to C:\Python24\Scripts Installing htconsole.exe script to C:\Python24\Scripts
Using c:\python24\lib\site-packages\htconsole-0.2-py2.4.egg Processing dependencies for htconsole Searching for Cheetah>=2a Best match: Cheetah 2.0rc6 Downloading http://69.9.164.2/sourceforge/cheetahtemplate/Cheetah-2.0rc6.tar.gz error: Download error: (10061, 'Connection refused')
I've gotten this from time to time as well. Something with how easy_install downloads from SF -- I think it retries when it gets some kinds of failures, but not all, and SF mirrors fail a lot. If you try it once or twice more it'll probably work, or you can download http://sourceforge.net/project/showfiles.php?group_id=28961&package_id=20864&release_id=391008 And then run "easy_install FileYouJustDownloaded.tar.gz" -- Ian Bicking / ianb@colorstudy.com / http://blog.ianbicking.org
participants (3)
-
Andre Roberge
-
Andrew Harrington
-
Ian Bicking