用于大型项目的Python [英] Python for large projects

查看:82
本文介绍了用于大型项目的Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我开始研究一个相当大的项目,我正在考虑使用python进行大部分编码,但我需要先确定它足够可靠。


我需要确保当我的程序在不同的真实系统上运行时,我不会有惊喜。到目前为止,我使用urllib用python编写了一个小脚本,并且在一台计算机上它完全失败,因为获取代理有问题(在我看来这是一个错误)。与C ++相比,这些事情发生的可能性有多大,频繁发生多少以及在多大程度上它们在python中更为普遍?


如果python确实适合大型项目,那么多么常见它是否真的用于此目的?是否有一个使用python的实际项目示例列表?


谢谢,


Bob


------------------------------------------------ -----------------------

沃拉!邮件,从Walla获取私人免费电子邮件! at:
http://mail.walla.co.il

Hello,

I am beginning to work on a fairly large project and I''m considering to use python for most of the coding, but I need to make sure first that it is reliable enough.

I need to make sure that I won''t have surprises when my program runs on different real-world systems. So far I wrote a little script with python using urllib, and on one computer it failed completely because of a problem in getting the proxies (in my opinion this is a bug). How likely are such things to happen and how often, and to what extent are they more prevalent in python in comparison to C++?

If python is indeed suitable for large projects, how common is it to actually use if for such purposes? Is there perhaps a list of examples of real projects using python?

Thanks,

Bob

-----------------------------------------------------------------------
Walla! Mail, Get Your Private, Free E-mail from Walla! at:
http://mail.walla.co.il

推荐答案

作为***** @ walla.com 写道:
如果python确实适合大型项目,那么为了这样的目的,实际使用它有多常见?是否有一个使用python的实际项目示例列表?
If python is indeed suitable for large projects, how common is it to
actually use if for such purposes? Is there perhaps a list of examples of
real projects using python?




自动内存管理的好处足以让我相信它可以胜任C ++。强大的内置类型是另一个巨大的胜利 - 你将用什么来支付C ++中的年龄编码通常是Python中没有用的。


显然有缺点,我发现缺少静态类型检查

导致我的代码中隐藏一些错误,在编译时会发现其他语言中的
。总的来说(和恕我直言),优点远远超出了利弊。


有一个相当大的公司列表,使用Python
http://pythonology.org/success


HTH,

Andrew



I would say that Python is very suitable for use in large projects, just the
benefit of automatic memory management is enough to convince me that it
beats C++. The powerful builtin types are another big win - what you would
spend ages coding in C++ is often a no brainer in Python.

Obviously there are downsides, I find the lack of static type checking to
cause some bugs to hide in my code that in other languages would be found
at compile time. In general (and IMHO) though, the pros far outway cons.

There is a decent sized list of companies that use Python at
http://pythonology.org/success.

HTH,
Andrew


作为***** @ walla.com 写道:
我开始研究一个相当大的项目,我正在考虑使用python进行大部分编码,但我需要先确定<它足够可靠。

当我的程序在不同的真实系统上运行时,我需要确保我不会有惊喜。到目前为止,我使用urllib编写了一个带有
python的小脚本,并且在一台计算机上它完全失败,因为获取代理有问题(在我看来这是一个错误)。与C ++相比,这些事情发生的频率和频率,以及它们在python中的普及程度有多大?


Python语言通常设计精良,比C ++更简洁.b $ b。 C ++中的一个大程序可能会映射到一个更小的Python

程序,将一个大型项目转变为一个小项目,并且无论Python是否适用于大型项目,都会使它变得无关紧要。


Python的库确实有很多小的空白,比如你在urllib中找到的那个
。正如扭曲矩阵文档所说,你会发现你自己重新发明轮子很多,因为你发现现有的轮子通常是方形的并且是由胶水制成的。

如果python确实适合大型项目,那么为了这样的目的,实际使用它有多常见?是否有一个使用python的真实项目示例列表?
I am beginning to work on a fairly large project and I''m considering
to use python for most of the coding, but I need to make sure first
that it is reliable enough.

I need to make sure that I won''t have surprises when my program runs
on different real-world systems. So far I wrote a little script with
python using urllib, and on one computer it failed completely
because of a problem in getting the proxies (in my opinion this is a
bug). How likely are such things to happen and how often, and to
what extent are they more prevalent in python in comparison to C++?
The Python language is in general well-designed and much more concise
than C++. A big program in C++ may map to a much smaller Python
program, turning a large project into a small project, and making it
less relevant whether Python works for large projects.

Python''s library does have a lot of small gaps like the one you found
in urllib. As the Twisted Matrix documentation puts it, you find
yourself re-inventing the wheel a lot, because you discover that the
existing wheels are often square and made of glue.
If python is indeed suitable for large projects, how common is it to
actually use if for such purposes? Is there perhaps a list of
examples of real projects using python?




复杂Python项目的规范示例是Zope

www.zope.com)。按照大C ++

项目的标准,它的中等大小,但如上所述,中等数量的Python代码可以实现功能需要更多的
C ++。


因为Python被解释并且非常动态,所以Python程序往往比同类C ++程序运行得慢。这是否是一个问题

取决于你的申请。如果您有特定的Python

函数是瓶颈,您可以在C中重新实现它们,并且
通过Python的C API调用它们。还有一个名为Psyco的半实验性的b $ b原生代码Python编译器,以增加内存消耗为代价,产生了相当大的b $ b加速。

下一代Python实现(Python中的PyPy或Python)将报告使用Psyco或simliar,以更基本的方式使用


简而言之,对于你的问题,你的问题并不是一个快速而简单的答案。这对于很多东西来说都很棒,对于其他一些东西来说并不是那么热门,并且仍在迅速发展,所以今天不合适的应用程序可能适合于

即将发布。



The canonical example of a complex Python project is Zope
(www.zope.com). It''s medium sized by the standards of big C++
projects, but as mentioned, a medium amount of Python code can
implement functionality that would take a much larger amount of C++.

Because Python is interpreted and highly dynamic, Python programs tend
to run slower than comparable C++ programs. Whether that''s a problem
for you depends on your application. If you have specific Python
functions that are bottlenecks, you can re-implement them in C and
call them through Python''s C API. There''s also a semi-experimental
native-code Python compiler called Psyco that produces a considerable
speedup at the cost of increased memory consumption. The
next-generation Python implementation (PyPy or Python in Python) will
reportedly use Psyco or something simliar, in a more fundamental way.

In short, there''s not a quick and simple answer to your question of
whether Python is right for what you''re doing. It''s great for lots of
things, not so hot for some others, and is still evolving rather
quickly, so an unsuitable application today may become suitable in a
forthcoming release.


文章< 7x ************ @ ruckus.brouhaha.com> ,

Paul Rubin< http://ph****@NOSPAM.invalid>写道:
In article <7x************@ruckus.brouhaha.com>,
Paul Rubin <http://ph****@NOSPAM.invalid> wrote:
作为***** @ walla.com写道:
as*****@walla.com writes:
我开始研究一个相当大的项目,我正在考虑
使用python进行大部分编码,但我需要首先确保它足够可靠。

我需要确保我的程序不会有惊喜在不同的真实世界系统上运行。到目前为止,我使用urllib编写了一个带有
python的小脚本,并且在一台计算机上它完全失败,因为获取代理有问题(在我看来这是一个错误)。与C ++相比,这些事情发生的频率和频率,以及它们在python中的普及程度有多大?
I am beginning to work on a fairly large project and I''m considering
to use python for most of the coding, but I need to make sure first
that it is reliable enough.

I need to make sure that I won''t have surprises when my program runs
on different real-world systems. So far I wrote a little script with
python using urllib, and on one computer it failed completely
because of a problem in getting the proxies (in my opinion this is a
bug). How likely are such things to happen and how often, and to
what extent are they more prevalent in python in comparison to C++?



Python语言通常很好 - 设计比C ++更简洁。 C ++中的一个大程序可能会映射到一个小得多的Python程序,将一个大项目变成一个小项目,并且无论Python是否适用于大型项目,它都不那么相关。
Python的库确实有很多小差距,比如你在urllib中找到的那个。正如Twisted Matrix文档所说,你发现你自己重新发明了轮子,因为你发现现有的轮子通常都是方形的并且用胶水制成。



The Python language is in general well-designed and much more concise
than C++. A big program in C++ may map to a much smaller Python
program, turning a large project into a small project, and making it
less relevant whether Python works for large projects.

Python''s library does have a lot of small gaps like the one you found
in urllib. As the Twisted Matrix documentation puts it, you find
yourself re-inventing the wheel a lot, because you discover that the
existing wheels are often square and made of glue.

如果python确实适合大型项目,那么为了这样的目的,实际使用它有多常见?是否有一个使用python的真实项目示例列表?
If python is indeed suitable for large projects, how common is it to
actually use if for such purposes? Is there perhaps a list of
examples of real projects using python?



复杂的Python项目的典型示例是Zope
www.zope.com)。根据大型C ++项目的标准,它的中等大小,但如上所述,中等数量的Python代码可以实现需要更多C ++的功能。
<由于Python具有解释性和高度动态性,因此Python程序比同类C ++程序运行速度慢。这对你来说是否有问题取决于你的申请。如果您有特定的Python功能,那么您可以在C中重新实现它们,并通过Python的C API调用它们。还有一个名为Psyco的半实验性原生代码Python编译器,以增加内存消耗为代价,产生了相当大的加速。据报道,下一代Python实现(Python中的PyPy或Python)将以更基本的方式使用Psyco或类似的东西。

简而言之,就是你的问题不是一个快速而简单的答案,而是Python是否适合你正在做的事情。对于很多东西来说它很棒,对其他东西来说并不那么热,并且仍在快速发展,所以今天不合适的应用程序可能会适用于即将发布的版本。



The canonical example of a complex Python project is Zope
(www.zope.com). It''s medium sized by the standards of big C++
projects, but as mentioned, a medium amount of Python code can
implement functionality that would take a much larger amount of C++.

Because Python is interpreted and highly dynamic, Python programs tend
to run slower than comparable C++ programs. Whether that''s a problem
for you depends on your application. If you have specific Python
functions that are bottlenecks, you can re-implement them in C and
call them through Python''s C API. There''s also a semi-experimental
native-code Python compiler called Psyco that produces a considerable
speedup at the cost of increased memory consumption. The
next-generation Python implementation (PyPy or Python in Python) will
reportedly use Psyco or something simliar, in a more fundamental way.

In short, there''s not a quick and simple answer to your question of
whether Python is right for what you''re doing. It''s great for lots of
things, not so hot for some others, and is still evolving rather
quickly, so an unsuitable application today may become suitable in a
forthcoming release.




您可能还有机会了解Pyrex和

....好吧,我在Trotskyite翼上就这个问题。

这不仅仅是Python可以用于大型项目。

我真诚地认为它是一个更好的*比较

选择大型项目; C ++和Java,通常的
请愿书,当人们按照项目的规模扩展时,会显示出各种各样的瑕疵。 Python仍然可以使用,即使是高端的


-


Cameron Laird< cl **** @ phaseit.net>

商家: http://www.Phaseit.net


这篇关于用于大型项目的Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆