程序部署 [英] program deployment

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

问题描述

这里的所有人,


i我正在学习Python,刚完成一本书,我开始写

程序。

我只是想问,是正确的将我的程序部署到其他的b $ b计算机,.pyc文件的方式??


我现在使用-m compileall。 switch可以将.py文件

编译成字节码。所以我想如果Python必须运行.pyc文件,那么它将加载并更快地执行它。如果我有一些敏感的话数据在

我的来源,如密码(以及cource的来源!),他们将在编译文件中更安全地使用
安全。


这是正确的吗?


非常感谢您的帮助!

hi to all folks here,

i am learning Python, just finished a book and i am starting to write
programs.
I just want to ask, is the "correct" way to deploy my programs to other
computers, the .pyc files ??

I now that with the "-m compileall ." switch can compile a .py file
into bytecodes. So i suppose that if Python has to run a .pyc file, it
will load and execute it faster. And if i have some "sensitive" data in
my source, like passwords (and the source of cource!) they will be more
secure in a compiled file.

Is that correct ?

Thanks a lot for any help!

推荐答案



king kikapu写道:

king kikapu wrote:

嗨这里的所有人,


i我正在学习Python ,刚刚完成一本书,我开始写

程序。

我只是想问,是正确的将我的程序部署到其他的b $ b计算机,.pyc文件的方式??


我现在使用-m compileall。 switch可以将.py文件

编译成字节码。所以我想如果Python必须运行.pyc文件,那么它将加载并更快地执行它。如果我有一些敏感的话数据在

我的来源,如密码(以及cource的来源!),他们将在编译文件中更安全地使用
安全。


这是正确的吗?


非常感谢您的帮助!
hi to all folks here,

i am learning Python, just finished a book and i am starting to write
programs.
I just want to ask, is the "correct" way to deploy my programs to other
computers, the .pyc files ??

I now that with the "-m compileall ." switch can compile a .py file
into bytecodes. So i suppose that if Python has to run a .pyc file, it
will load and execute it faster. And if i have some "sensitive" data in
my source, like passwords (and the source of cource!) they will be more
secure in a compiled file.

Is that correct ?

Thanks a lot for any help!



Python代码通常部署为直接源代码。在第一次运行时自动编译

,然后快速加载

。密码不属于源代码,只需通过分发字节码就可以确保密码不安全。这适用于任何

语言,编译的本机或字节代码。分发字节码可能会阻止非技术用户,但这只是关于它。

Python code is normally deployed as straight source code. It gets
compiled automatically on its first run and will subsequently load
this quickly. Passwords do not belong in the source code and they are
not secure simply by distributing bytecode instead. This applies to any
language, native or byte code compiled. Distributing bytecode may deter
non-technical users but that''s just about it.


Python代码通常部署为直接的源代码。


但这不是一个问题吗?我的意思是,如果知道他们的源代码在其他

机器上徘徊,很多人都觉得不好......

Python code is normally deployed as straight source code.

But isn''t this a problem of its own ?? I mean, many people do not feel
good if the know that their source code is lying around on other
machines...


king kikapu写道:
king kikapu wrote:

> Python代码通常部署为直接源代码。
>Python code is normally deployed as straight source code.



但这不是一个问题吗?我的意思是,如果知道他们的源代码在其他机器上存在,很多人都不觉得好b
$ b


But isn''t this a problem of its own ?? I mean, many people do not feel
good if the know that their source code is lying around on other
machines...



这个已经在这个名单上讨论了数十亿次 - 摘要是(至少来自我的POV的
):


- 可以很容易地解析python。所以,给自己省去

麻烦只发布pyc


- 如果有什么是_worth_
被黑客入侵,它将被黑客攻击


- 99%的代码都不值得被黑客入侵或被破解。真。即使

将许多缺乏想象力的代码拼凑在一起的结果可能会令人印象深刻,但只有很少的编码领域(例如

)值得翻录的复杂压缩算法等等 -

剩下的一定只能在一个应用程序中运行,因为它是紧密联系的




- 如果你有什么东西,你真的,真的,真的需要像

一样安全,去使用远程服务 - 否则,它会被泄露。

Diez

This has been discussed a bazillion times on this list - the summary is (at
least from my POV):

- it is possible to decompyle python pretty easy. So, spare yourself the
hassle just distributing only the pyc

- it is easy enough to hack even C-written apps, if anything is _worth_
being hacked, it will be hacked

- 99% of all code isn''t worth being hacked or ripped. Really. Even though
the result of cobbling together lots of unimaginative code might be
impressive, there are only very few areas of coding (like e.g.
sophisticated compression algorithms and the like) that are worth ripping -
the rest is bound to be runnable in one app only anyway, as it is coupled
closely

- if you have something you really, really, really need to be as secure as
possible, go use a remote service - otherwise, it _will_ be compromised.
Diez


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

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