Change IPython to BPython in shell mode

98 views
Skip to first unread message

Bruno Rocha

unread,
Apr 7, 2011, 10:13:32 AM4/7/11
to web...@googlegroups.com
hi,

does anybody knows how to run the web2py shell using BPython instead of IPython?

I saw a line in gluon/shell.py but I did not find argument to pass in console.

Would be great a way to run:

$python web2py.py - S appname -M -bpython

Is it possible or even changing in code?

Thanks
--
Bruno Rocha

Bruno Rocha

unread,
Apr 8, 2011, 11:37:54 AM4/8/11
to web...@googlegroups.com, web2py-developers

No idea?

Massimo Di Pierro

unread,
Apr 8, 2011, 12:07:43 PM4/8/11
to web2py-users
talking about this?

http://wiki.blender.org/index.php/Dev_talk:Source/BPython/API/bpy_api

It should be easy..
open the shell and type:

from gluon.globals import Request, Response, Session
from gluon.compileapp import build_environment(
request=Request()
response=Response()
session=Session()
request.application = '....'
globals().update(build_environment(request,response,session))



On Apr 8, 10:37 am, Bruno Rocha <rochacbr...@gmail.com> wrote:
> No idea?

Bruno Rocha

unread,
Apr 8, 2011, 1:50:39 PM4/8/11
to web...@googlegroups.com, Massimo Di Pierro
I Dont know if I am talking about the same thing.

When using web2py shell form console, if IPython is installed web2py shell runs in IPython interactive console.

I wqas wondering about change it to BPython by command line.

$python web2py.py -S appname -M  
>>> IPython shell running


$python web2py.py -S appname -M -bpython
>>>BPython shell running (if installed)

Jason Brower

unread,
Apr 8, 2011, 1:53:19 PM4/8/11
to web...@googlegroups.com
+1 BPython kicks some seriouls python console!
BR,
Jason

ron_m

unread,
Apr 10, 2011, 8:48:53 AM4/10/11
to web...@googlegroups.com
First item on Blender page you reference, big discussion on auto import bpy. All the arguments look familiar. :-)

Arun K.Rajeevan

unread,
Apr 11, 2011, 2:47:02 PM4/11/11
to web...@googlegroups.com
I think he is talking about http://bpython-interpreter.org/
Which is a lightweight python console with auto completion and etc.,

To support this, add an option in gluon/widget.py for additional command line switch
And then in gluon/shell.py (around line no: 204 add option for bPython)
import bpython
bpython.embedd() #pass-in appropriate parameters

I haven't looked exactly how we can make use of bpython from within our own application.
But it's something like that.

May be I can provide a patch for this.
Reply all
Reply to author
Forward
0 new messages