开发者

Is it possible to run the Google App Engine SDK from a shell?

Is it possible to run the Google App Engine SDK from a shell so I can use the Python Debugger? Running it from the GUI is nice, but you get no STDIN/STDOUT, so I can't set_trace and step through my code.

Barring that, is there any other way to achieve interactive debugging with GAE when developing locally?

I'm on Wi开发者_运维百科ndows 7.


The command you are looking for is dev_appserver.py which starts the development SDK (just like the launcher does for you).

STDIN/STDOUT is captured by the SDK so use the logging module to dump to the console screen.

Also pretty sure there is a 'log' screen in the GUI that will show the output, but I don't use the GUI myself.


Why dont you try PyDev with Eclipse? It would allow you to set breakpoints and step through code to debug your apps.

I am on a Linux desktop and mac laptop, so I cant comment about Windows 7. But I am pretty sure you can setup Eclipse + Pydev + App Engine on your windows machine. I always use PyDev on Eclipse, I have never used google's GUI app.

It requires a lot of patience, please be prepared. You will have to figure out how to install Python 2.5.2, set the necessary paths so your PyDev imports modules like logging etc. But you will definitely like the end result.


You can set_trace and redirect output to the dev_appserver.py console from your code:

def dbg():
    import pdb
    import sys
    pdb.Pdb(stdin=getattr(sys,'__stdin__'),stdout=getattr(sys,'__stderr__')).set_trace(sys._getframe().f_back)


I am running python GAE on windows 7. You are definitely going to want to use the Eclipse Classic IDE with the google app engine plugin. Check out this video:

http://www.youtube.com/watch?v=e1dtyQ6wqzc

It tells you step by step how to setup everything.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜