Python链接器 [英] Python linker

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

问题描述

我喜欢python - 我用它作为一种实用语言,每天补充我的C#

编程。但是,我不使用它作为我的

主要语言的原因是 - 惊讶,惊讶 - 不是缺少静态类型

检查,但是独立执行的大小(嵌入python

运行时)。


是否可以将已使用的函数链接到您的

结果可执行文件中?毕竟,一个典型的应用程序可能只使用$。
。在Python .dlls中的所有内容的20%。


这同样适用于wxPython - 它将是如果您只能在需要的地方链接

,那就太棒了。是否有可能在所有

(可能基于GCC)上编写这样的链接器?

解决方案

< by ********* @ googlemail.comwrote:


>我喜欢python - 我用它作为实用语言来补充我的C#
每天编程。但是,我不使用它作为我的主要语言的原因是 - 惊喜,惊喜 - 不是缺乏静态类型的检查,而是独立执行的大小(嵌入python的
)运行)。



呃,什么?你是如何生成独立的可执行文件的?什么

大小是可接受的? python24.dll只有1.8M - 当然在任何

非嵌入式平台上这些天1.8M都不值得打扰。

因为你提到了wx(所有另一个4.8M)我猜我们是在谈论桌面应用程序。谁会注意到你的

可执行文件是否比M更瘦?


-

\ S - si***@chiark.greenend.org.uk - http://www.chaos.org.uk/~sion/

___ | 坦率地说,我对这种或那种企鹅没有任何感情

\ X / | --Arthur C. Clarke

她的怒吼得到了什么?ddre heddes b?ce bump bump bump


由********* @ googlemail.com 写道:


我喜欢python - 我用它作为一种实用语言,每天补充我的C#

编程。但是,我不使用它作为我的

主要语言的原因是 - 惊讶,惊讶 - 不是缺少静态类型

检查,但是独立执行的大小(嵌入python

运行时)。



为什么不安装Python本身,

这样所有的python程序每个只有几Kb。

因为他们都使用单一的共享安装。


--Irmen



由********* @ googlemail.com 写道:


我喜欢python - 我用它作为一种实用语言,每天补充我的C#

编程。但是,我不使用它作为我的

主要语言的原因是 - 惊讶,惊讶 - 不是缺少静态类型

检查,但是独立执行的大小(嵌入python

运行时)。


是否可以将已使用的函数链接到您的

结果可执行文件中?毕竟,一个典型的应用程序可能只使用$。
。在Python .dlls中的所有内容的20%。


这同样适用于wxPython - 它将是如果您只能在需要的地方链接

,那就太棒了。是否有可能在所有

(可能基于GCC)中编写这样的链接器?



对于您的发行版,只需将您的DLL移动到相应的系统

文件夹。这就是DLL的作用。你把它们扔进system32,忘了它们

首先在那里,而且Linker Troll完成剩下的工作来为

你。


I love python - I use it as a utility language to complement my C#
programming every day. However, the reason I do not use it as my
primary language is - surprise, surprise - not its lack of static type
checking, but the size of standalone executes (which embed the python
runtime).

Would it be possible to link only the used functions into your
resulting executable? After all, a typical application might only use
20% of everything that is in the Python .dlls.

The same applies to wxPython - it would be great if you could only link
in what you need. Would it be possible to write such linkers at all
(maybe based on GCC)?

解决方案

<by*********@googlemail.comwrote:

>I love python - I use it as a utility language to complement my C#
programming every day. However, the reason I do not use it as my
primary language is - surprise, surprise - not its lack of static type
checking, but the size of standalone executes (which embed the python
runtime).

Er, what? How are you generating your standalone executables? What
size is "acceptable"? python24.dll is only 1.8M -- surely on any
non-embedded platform these days 1.8M isn''t worth bothering about.
And since you mention wx (all of another 4.8M) I''d guess we''re
talking about desktop applications. Who''s going to notice if your
executable is a couple of M slimmer?

--
\S -- si***@chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the other"
\X/ | -- Arthur C. Clarke
her nu becomet se bera eadward ofdun hl?ddre heafdes b?ce bump bump bump


by*********@googlemail.com wrote:

I love python - I use it as a utility language to complement my C#
programming every day. However, the reason I do not use it as my
primary language is - surprise, surprise - not its lack of static type
checking, but the size of standalone executes (which embed the python
runtime).

Why not just install Python itself,
so that all of your python programs are only a few Kb each.
Because they all use the single shared installation.

--Irmen



by*********@googlemail.com wrote:

I love python - I use it as a utility language to complement my C#
programming every day. However, the reason I do not use it as my
primary language is - surprise, surprise - not its lack of static type
checking, but the size of standalone executes (which embed the python
runtime).

Would it be possible to link only the used functions into your
resulting executable? After all, a typical application might only use
20% of everything that is in the Python .dlls.

The same applies to wxPython - it would be great if you could only link
in what you need. Would it be possible to write such linkers at all
(maybe based on GCC)?

For your distribution, just move your DLLs to the appropriate system
folder. That''s what DLLs do. You throw them in system32, forget they
were there in the first place, and the Linker Troll does the rest for
you.


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

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