100%便携? [英] 100 % portable ?

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

问题描述

我对python的可移植性有一些疑问


我的部分我在3个系统下工作(windows,linux,mac os x

有时mac也是经典的os)


i想知道我怎么能100%确定我的程序是便携的

(我不想每次使用其他代码系统)


i假设GUI是一样的


这件事我需要注意(语言,系统,库......)

你有一些图形库提议(我看到GTK,Tkinter和

WXwindow)


thankx提前为你回复


东风

i have some question about portability of python

for my part i work under the 3 systemes (windows , linux , mac os x
sometimes mac os classic too )

i want to know how i can be sure at 100 % that my programme is portable
(i dont want code each times i use other system )

i suppose for GUI is same

wich thing need i pay attention (language , system , library .. )
do you have some graphic library to propose (i see GTK , Tkinter and
WXwindow )

thankx in advance for you reply

East wind

推荐答案

你怎么能确定?我建议你为你的软件编写一个测试套件,然后在你想要定位的所有平台上运行它。


另一方面,Python已经相当不错。在过去,至少在涉及Windows,Linux和Unix的地方,对我来说是便携性。


Jeff


----- BEGIN PGP SIGNATURE -----

版本:GnuPG v1.2.5(GNU / Linux)

iD8DBQFBKJ7rJd01MZaTXX0RAgo9AJ9oRbnBELKKQSlgdChWPx 3HiGUiOwCbBSpW

FfLI3BXczpX1nB + WVoml6 / 4 =

= wMfB

----- END PGP SIGNATURE -----
How can you be sure? I recommend you do it by writing a test-suite for
your software and running it on all the platforms you wish to target.

On the other hand, Python has had "pretty good" portability for me in
the past, at least where Windows, Linux, and Unix are concerned.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBKJ7rJd01MZaTXX0RAgo9AJ9oRbnBELKKQSlgdChWPx 3HiGUiOwCbBSpW
FfLI3BXczpX1nB+WVoml6/4=
=wMfB
-----END PGP SIGNATURE-----


Ventd''Est - East Wind写道:
Vent d''Est - East Wind wrote:
我想知道如何100%确定我的程序是便携的
(我不想每次使用其他系统的代码)


您必须在所有平台上运行您的程序。 Python

库文档页面告诉您模块

所在的平台。绝大多数是全部。


请注意,对于某些事情,您需要不同的代码。对于

示例,保存文件的默认位置可能是Windows上的My Documents

和Linux和Mac上的
i want to know how i can be sure at 100 % that my programme is portable
(i dont want code each times i use other system )
You will have to run your program on all platforms. The Python
library documentation pages tell you which platform the modules
are on. The vast majority are on all.

Note that for some things you would want different code. For
example the default location to save files may be My Documents
on Windows and


HOME。同样地,你会想要在Windows上的注册表中保存配置设置

和Linux和Mac上的点文件。

i假设GUI是相同的
HOME on Linux and Mac. Similarly you would
want to save configuration settings in the registry on Windows
and dot files on Linux and Mac.
i suppose for GUI is same




我首选的工具包是围绕wxWidgets的wxPython包装器。

尽可能使用本机小部件。它还具有其他工具包经常缺少的功能,例如打印,键盘,配置(后端到注册表,文件等)。


只是为了给你一些想法,在我的30,000行程序中有

5测试,看看它运行的是什么平台,特别是

确保适当的默认值等对于平台。


对于gui,有两个程序可以尝试使用wxPython。

http://dotamatic.sf.net
http://bitpim.org


两者都是开源的,所以你可以亲自看看。两者都使用

剪贴板,进行打印,有在线帮助,分发如此

用户在他们的机器上已经不需要Python等等。


Roger



My preferred toolkit is the wxPython wrapper around wxWidgets.
Wherever possible it uses native widgets. It also has functionality
often lacked by other toolkits such as printing, keyboard,
configuration (backend to registry, files etc).

Just to give you some idea, in my 30,000 line program there are
5 tests to see what platform it is running on, specifically to
ensure appropriate defaults etc for the platform.

For the gui, there are two programs you can try that use wxPython.

http://dotamatic.sf.net
http://bitpim.org

Both are open source so you can see for yourself. Both use the
clipboard, do printing, have online help, are distributed so
that the user doesn''t need Python on their machine already etc.

Roger


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

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