MezzoNZ / crunchy

Automatically exported from code.google.com/p/crunchy
0 stars 0 forks source link

Functionality covering Python's -i #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As suggested by cappy2112 on the crunchy-discuss mailinglist:

A commandline switch that makes crunchy start up with a page containing
only an interpreter, mirroring the functionality of the python
interpreter's -i switch.

Should this switch also be -i (seems sensible to minimise confusion) or
does something else make more sense?

Original issue reported on code.google.com by johannes...@gmail.com on 19 Jan 2008 at 6:04

GoogleCodeExporter commented 8 years ago
A couple of comments:

1. It makes sense to me that the switch should also be -i.

2. I think that consideration to issue 66 (starting crunchy with an arbitrary 
page)
should be given at the same time, since in both cases it would start with a
non-default page.  However, for issue 66, I believe that the switch should be 
--url
desired_url.  I'll be adding some comments more specific to issue 66.

Original comment by andre.ro...@gmail.com on 19 Jan 2008 at 6:35

GoogleCodeExporter commented 8 years ago
This is *almost* implemented by loading a page via --url option.  One loads a 
python
file and is presented with a page where that file is preloaded, both with an
interpreter present and an editor.  Upon clicking on the editor icon of the
interpreter, one can feed the code to the interpreter.

The only difference (which may be tricky to implement) is that __name__ is 
equal to
"__builtin__" and not to "__main__" when feeding the file to the interpreter.

Original comment by andre.ro...@gmail.com on 3 Feb 2008 at 4:33

GoogleCodeExporter commented 8 years ago
Implemented.   Similar to --url option except that
__name__ = "__main__"
is inserted before the code sample to be executed.

Original comment by andre.ro...@gmail.com on 3 Feb 2008 at 4:57