Python安装可以像PHP一样干净吗? [英] Can Python installation be as clean as PHP?

查看:77
本文介绍了Python安装可以像PHP一样干净吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢Python,但我不喜欢Python的安装。

使用PHP,我只需要一个文件(在Linux上)和两个文件
$ b在Windows上$ b然后我可以运行我的PHP脚本。这意味着没有安装

在大多数情况下是必需的。我只是复制文件,我得到PHP。

扩展PHP也很简单,只需复制一些DLL

并稍微修改php.ini。 br />

使用Python,事情真的很混乱。我必须运行安装程序

来安装几十个目录和数百个文件,而且我不知道
真的知道是否所有这些都是必要的。另外,许多库

都是.py,当然不像C / C ++中内置的所有核心函数那样高效/干净核心,就像在PHP中一样。


然后,我再次喜欢Python语言。如果可以用PHP方式制作Python(或Python的一种变体),一个

的可执行文件,那就太好了。

解决方案

如果这让你烦恼,为什么不坚持使用Python安装的Linux发行版



很少有人不会。


杰克:

我必须运行安装程序来安装几十个目录
数百个文件,


这个并不罕见,大多数人认为不是问题。

我不是真的知道是否所有这些都是必要的。


别打扰你。生命太短了。

另外,很多库都是.py,当然不像内置的所有核心功能一样高效/干净br /> C / C ++核心,就像PHP一样。




性能关键部分_are_用C / C ++实现。但并非一切

属于这一类。是的,可能还有更大的性能空间

的改进。就像PHP一样。例如,您知道吗?默认情况下,PHP不会存储和重复使用脚本的编译版本吗?

使用PHP,你需要摆弄eAccelerator ,Zend等。

Python解释器会自动执行此操作。


在Python中使用库代码也有好处,例如

在Python调试器中无缝调试它。此外,Python API'倾向于

比PHP更清晰。这可能反映了他们实施的语言




-
$ b $bRenéPijlman


>使用Python,事情真的很混乱。我必须运行安装程序

来安装几十个目录和数百个文件,而且我不知道是否所有这些都是必要的。另外,许多库都是.py,这当然不像C / C ++核心中内置的所有核心功能那样高效/干净,就像在PHP中一样。 />
然后,我再次喜欢Python语言。如果Python(或Python的一种变体)可以用PHP方式,一个可执行文件,你可以得到所有东西,那将是很棒的。




你对事物的看法有点扭曲。我一直在诅咒PHP

完全相同的monolitic性质。如果你需要例如

oracle支持,你必须重新编译整个批次,而不仅仅是一个模块

,因为它没有没有C模块的概念 - 所以你可以''添加功能

除了使用PHP-includes。效率如此之高。


Diez


I like Python but I don''t really like Python''s installation.
With PHP, I only need one file (on Linux) and maybe two files
on Windows then I can run my PHP script. This means no installation
is required in most cases. I just copy the file and I get PHP.
Extending PHP is fairly easy, too, just by copying a few DLLs
and modifying the php.ini a bit.

With Python, things are really messy. I have to run the installer
to install dozens of directories and hundreds of files, and I don''t
really know if all of them are necessary. Plus, lots of libraries
are in .py, which is of course not as efficient/clean as having all
of the core functions built-in in the C/C++ core, like in PHP.

Then again, I do like the Python language. It would be great if
Python (or a variation of Python) can be made the PHP way, one
executable file, and you get everything.

解决方案

If this bothers you, why don''t you stick to a linux distro with Python
installed.
Very few don''t.


Jack:

I have to run the installer to install dozens of directories and
hundreds of files,
That''s not unusual and not considered a problem by most people.
and I don''t really know if all of them are necessary.
Don''t let that bother you. Life''s too short.
Plus, lots of libraries are in .py, which is of course not as
efficient/clean as having all of the core functions built-in in
the C/C++ core, like in PHP.



Performance-critical parts _are_ implemented in C/C++. But not everything
falls into this category. Yes, there''s probably room for more performance
improvements. Just like there is with PHP. Did you know, for example, that
PHP doesn''t store and re-use compiled versions of the scripts by default?
With PHP you need to fiddle with eAccelerator, Zend and the like. The
Python interpreter does this automatically.

There are advantages to having library code in Python too, such as being
able to seemlessly debug it in a Python debugger. Also, Python API''s tend
to be a lot cleaner than PHP''s. This probably reflects the language
they''re implemented in.

--
René Pijlman


> With Python, things are really messy. I have to run the installer

to install dozens of directories and hundreds of files, and I don''t
really know if all of them are necessary. Plus, lots of libraries
are in .py, which is of course not as efficient/clean as having all
of the core functions built-in in the C/C++ core, like in PHP.

Then again, I do like the Python language. It would be great if
Python (or a variation of Python) can be made the PHP way, one
executable file, and you get everything.



You have a somewhat distorted view of things. I''ve been cursing PHP
quite a few times exactly for that monolitic nature. If you need e.g.
oracle support, you have to recompile the whole lot, not just a module
as it has no no C-module concept - so you can''t add functionality
besides using PHP-includes. So much for efficiency.

Diez


这篇关于Python安装可以像PHP一样干净吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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