简体   繁体   English

在金字塔上使用外部python库

[英]Use external python libraries on Pyramid

Can I use any external libraries that are developed for python on Pyramid ? 我可以使用在Pyramid上为python开发的任何外部库吗? I mean is it the 'normal python' to which I can import external libraries as I do with the standard python downloaded from python.org 我的意思是,就像从python.org下载的标准python一样,我可以将外部库导入“普通python”

What is the situation for Django and Flask and Bottle ? DjangoFlask and Bottle的情况如何?

My intention is to create backend for a mobile app. 我的意图是为移动应用程序创建后端。 I want to do it specifically in Python because I need to learn python. 我想专门在Python中做,因为我需要学习python。

The app is a native android app. 该应用程序是本机android应用程序。 Therefore the there is no need to use response with nice html code. 因此,无需将响应与漂亮的html代码一起使用。

I just want Django/Flask/Pyramid to direct http request to relevant python functions. 我只希望Django / Flask / Pyramid将http请求定向到相关的python函数。 Everything else including user auth, database is handled by my code I write. 其他所有内容,包括用户身份验证,数据库,均由我编写的代码处理。 Is there a better more simpler way to map http request/responses with the relevant functions without using these 3 platforms? 在不使用这三个平台的情况下,是否有更好,更简单的方法来映射具有相关功能的http请求/响应?

In case I use one of these can I still use my own libraries? 如果我使用其中之一,我仍然可以使用自己的库吗?

Yes, all of those frameworks are simply running Python code to handle requests. 是的,所有这些框架都只是运行Python代码来处理请求。 Within limits you can use external libraries just fine. 在限制范围内,您可以使用外部库。

The limits usually are dictated by the WSGI server and the nature of HTTP requests; 限制通常由WSGI服务器和HTTP请求的性质决定; if your library changes the event model (like gevents) or relies heavily on changing the interpreter state (global state, localization) or takes a long,long time to produce results, then you may need to do more work to integrate. 如果您的库更改了事件模型(例如gevents)或严重依赖于更改解释器状态(全局状态,本地化),或者花费很长时间来产生结果,那么您可能需要做更多的工作来进行集成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM