开发者

Google App Engine, Python and IPython

开发者 https://www.devze.com 2023-01-12 01:02 出处:网络
I want to use 开发者_Python百科IPython under GAE to debug scripts locally: import ipdb; ipdb.set_trace()

I want to use 开发者_Python百科IPython under GAE to debug scripts locally:

import ipdb; ipdb.set_trace()

but GAE restricts loading some modules from sys.path. Can I bypass this somehow?


You can hack the GAE SDK's restrictions of course (you do have its sources on your computer, and it's open-source code!-), but, if you do, it won't catch the cases in which your code erroneously tries to import modules it won't be allowed to use on Google's servers. So I suggest, at the very least, if you do perform such a hack, make it conditional on some environment variable (if os.getenv('MYHACK')=='Y': ...), so that it's disabled by default (and the GAE SDK behaves normally) and you only enable it explicitly at your shell with e.g.

$ MYHACK=Y ipython ...

at a bash (or sh;-) prompt.

0

精彩评论

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