Python的一切? [英] Python for everything?

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

问题描述

我之前发表了一篇关于我老板编程的文章。现在我是

会问一个关于我自己编程的问题。我刚刚完成了我的

第一个C ++类。下学期是关于加密的课程(而且它也可能是一个数学课)。最后回到编程中使用C ++和Java 1来fall
.C ++将覆盖指针,并链接

列表,排序算法等...我运行linux和OS X.我已经阅读了

过去的日子,C被用于一切。这是一个系统

编程语言,也做了很多相同的东西Bash脚本

和perl现在做。所以,在那个时代,C做到了这一切,从短到高。我的

问题是,Python可以全部完成吗?我想知道要学习什么作为我的

脚本语言。我已经读过Perl很好,大约250美元b $ b行,之后它变得有点毛茸茸。但是,从我听说过的关于Python的一点点来看,它非常适合于可读性,因为

是该语言的空白要求,而且非常适合大型

项目由于它有大量的模块而且面向对象

结构。我想知道Python是否适合用作编程unix的通用语言,从简短的

脚本到泥浆。感谢您的耐心,意见和评论。


Xeys

I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it''s
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was used for everything. It was a systems
programming language, and also did a lot of the same stuff Bash scripts
and perl do now. So, in that era, C did it all, from short to tall. My
question is, can Python "do it all"? I am wondering what to learn as my
scripting language. I have read that perl is good up to about 250
lines, and after that it gets kind of hairy. However, from what little
I have heard about Python, it''s very well suited for readability due to
the whitespace requirements of the language, and very good for large
projects due to it''s large amount of modules and it''s object oriented
structure. I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from short
scripts to muds. Thanks for your patience, opinions, and comments.

Xeys

推荐答案

Python for除了需要可笑的东西之外的所有东西

针对速度进行了优化。这就是嵌入在Python和Psyco中的C增强了什么?
Python代码用于。


哦等等,那仍然是所有Python ......

Python for everything except things that need to be ridiculously
optimized for speed. Thats what C embedded in Python and Psyco enhanced
Python code is for.

Oh wait, thats still all Python...


简短答案是肯定的。


更长的答案:你仍然需要C代表设备驱动程序和其他

具有高性能要求的应用程序。从

Python调用C非常简单。 Python可以从短的shell中使用。脚本编写

到非常大的项目(参见Zope,Plone,ReportLab等)。其他

比C,Python是我能写的唯一语言

Windows服务(或* nix守护进程),COM对象,GUI程序,文本

程序和无头程序(例如没有产生
控制台输出的程序)。我对Python的工作效率要高得多。通过选择

Python,你承诺非常好地学习一种语言而不是

用不同的语言跳过你只记得很难的b / b
。当新版本的Python发布时,你只需要学习什么是新的。

如果你试图跟上C,C ++,Visual Basic,那就......

不可能。


希望信息有帮助。


拉里贝茨
xe ***** @ yahoo.com 写道:
Short answer is yes.

Longer answer: You will still need C for device drivers and other
applications that have high performance demands. Calling C from
Python is quite easy. Python can be used from short "shell" scripting
to projects that very large (see Zope, Plone, ReportLab, etc). Other
than C, Python is the only language that I''ve been able to write
Windows Services (or *nix daemons), COM objects, GUI programs, text
programs, and headless programs (e.g. programs that produce no
console output). I''m much more productive with Python. By choosing
Python you commit to learning one language extremely well instead of
jumping all over with different languages that you can remember only
poorly. When new version of Python ships, you just learn what is new.
If you try to keep up with C, C++, Visual Basic, ... it gets to be
impossible.

Hope information helps.

Larry Bates
xe*****@yahoo.com wrote:
我之前发布了一篇关于我老板编程的文章。现在我要问一个关于为自己编程的问题。我刚刚完成了我的第一个C ++类。下学期是一门关于加密的课程(而且它也可能是一门数学课)。最后回到C ++和Java的秋季编程中.C ++将覆盖指针,链接列表,排序算法等...我运行linux和OS X.我已阅读过去C用于一切的旧时代。它是一种系统编程语言,并且还做了很多相同的东西Bash脚本和perl现在做的事情。所以,在那个时代,C做到了这一切,从短到高。我的问题是,Python可以做到这一切吗?我想知道要学习什么作为我的脚本语言。我已经读过Perl最好可以达到大约250行,之后会变得有点毛茸茸。但是,从我听说过的关于Python的一点点来看,由于语言的空白要求,它非常适合于可读性,并且非常适用于大型项目,因为它'大量的模块和它的面向对象的结构。我想知道Python是否适合编程unix的通用语言,从简短的脚本到泥巴。感谢您的耐心,意见和评论。

Xeys
I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it''s
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was used for everything. It was a systems
programming language, and also did a lot of the same stuff Bash scripts
and perl do now. So, in that era, C did it all, from short to tall. My
question is, can Python "do it all"? I am wondering what to learn as my
scripting language. I have read that perl is good up to about 250
lines, and after that it gets kind of hairy. However, from what little
I have heard about Python, it''s very well suited for readability due to
the whitespace requirements of the language, and very good for large
projects due to it''s large amount of modules and it''s object oriented
structure. I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from short
scripts to muds. Thanks for your patience, opinions, and comments.

Xeys



< xe ***** @ yahoo.com> ;写道:
<xe*****@yahoo.com> wrote:
我以前读过C用于一切。它是一种系统编程语言,也做了很多相同的东西
Bash脚本和perl现在做。


我在过去的日子里学到了C语言。 (1977年或78年)。我们有足够的其他工具来编写脚本。在perl之前,我们肯定有shell

脚本(虽然早期的shell没有像

bash / ksh / etc那么强大),还有健康的实用程序如

grep / sed / sort和awk。我不知道有谁曾试图用C做一些事情。

我的问题是,Python可以做到这一切吗?


可能不是。我无法想象用
Python编写操作系统;你永远不会得到你需要的表现。对于非常低级别的b $ b东西,它们与硬件接口和带有钻头的东西,它也可能是错误的工具。

我想知道要学习什么作为我的脚本语言。
I have read in the old days that C was used for everything. It was a
systems programming language, and also did a lot of the same stuff
Bash scripts and perl do now.
I learned C in "the old days" (1977 or maybe 78). We had plenty of
other tools for scripting. Before perl, we certainly had shell
scripts (although the early shells were not as powerful as
bash/ksh/etc), along with a healthy dose of utilities like
grep/sed/sort and awk. I don''t know anybody who tried to do
everything in C.
My question is, can Python "do it all"?
Probably not. I couldn''t imagine writing an operating system in
Python; you''d never get the performance you need. For very low-level
stuff that interfaces with hardware and twiddles with bits, it''s
probably the wrong tool as well.
I am wondering what to learn as my scripting language.




Python是一种优秀的脚本语言,我强烈建议你

学习它。但是,对于某些利基,有更好的工具。如果你

主要目标是执行其他进程并操纵文件,对于

例子,bash可能是一个更好的工具。


通常,您选择的工具将由外部约束决定。

如果您尝试与某些第三方系统接口,只有

有perl或者java API(不是一个不常见的情况),你将用perl或java来实现它。



Python is an excellent scripting language, and I strongly urge you to
learn it. But, for certain niches, there are better tools. If you
main goal is to execute other processes and manipulate files, for
example, bash is probably a better tool.

Often, your choice of tool will be dictated by external constraints.
If you''re trying to interface to some third-party system which only
has a perl or java API (not an uncommon situation), you''re going to be
doing it in perl or java.


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

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