Linux GUI编程的第一印象 [英] First Impressions of Linux GUI Programming

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

问题描述

我希望我不会厌倦这种个人经历。但是,我希望

这些细节对其他Python和/或Linux新手有用,或者对那些考虑成为这样的人来说是有用的。


我已经在Windows上使用Python几年了。吸引我使用Python的其中一件事就是它提供了学习在Linux中编程的可能性,甚至没有使用Linux。

几年前我认识到,一旦它成熟了,Linux最终将成为我将使用的

平台。


我的第一个Python GUI要学习的工具包是wxPython,我什么都没有

,但是要说些好话。但是,过了一段时间后,我开始寻找一个ide来避免编码GUI的一些繁琐方面。我还没有完全确定他们中的任何一个,但是对于我写的一些小的实用工具,我最喜欢使用PythonCard。

我也听说过关于PyQt的很多东西,但是我一直不鼓励尝试它,因为在Windows上没有GPL版本(我是
认为这是Trolltech的一个错误,但这是另一个问题。


我最近收到了Mandrake 9.2的副本(包括在内) 2003年12月发行的Linux格式杂志上的b $ b,所以我决定将它安装在一台

测试机器上。一切顺利,看起来很漂亮。它已经安装了Python 2.3附带的
。我有几分钟的时间来支付
,所以我决定快速浏览一下PyQt。我下载了跟随rpms的



PyKDE-3.7-1mdk92.i586.rpm,PyQt-3.7-1mdk92.i586.rpm,

PyQt-devel-3.7-1mdk92.i586.rpm,libqscintilla2-1.1-1mdksbe.i586.rpm,

libqscintilla2-devel-1.1-1mdksbe.i586.rpm,

libsip10-3.7-mdk92.i586.rpm,libsip10-devel-3.7-mdk92.i586.rpm,

sip-3.7-mdk92.i586.rpm

正如我所说,我只有几分钟的时间。所以,当我遇到麻烦时,我没有花时间去寻求解决方案。 (我认为
认为安装得很好但Python找不到qt)。作为一个

最后的手段,我尝试从源代码构建PyQt,但它抱怨

没有找到Python.h。这导致我在C.L.P.的一个职位。提到要在Mandrake中安装PyQt,建议安装一个

单独的Python副本来代替发送的那个。我的测试

机器有一个小(3GB)硬盘,所以我决定推迟。


完成后,我决定尝试wxPython。我去了网站,

下载了rpm。下载后,我只需右键单击它,

选择打开方式...,然后选择软件安装程序。它毫无障碍地进入了
。我打开了一个终端会话来运行Python,导入了

wx,它运行起来了。我甚至尝试编写了一个小的wxPython YES_NO

对话框窗口,就在那里。


在成功的鼓舞下,我为

Mandrake。再次,它安装得像wxPython一样顺利。它甚至可以在K菜单上为代码和资源编辑器放置
链接。他们

都运作良好。我很快从Windows复制了一个我的小PythonCard

程序。我使用了打开方式和打开方式。在

PythonCard编辑器中打开脚本。我删除了几个Windows特定的电话,

保存它,并启动它。哇,就在那里。我现在是Linux

程序员。好吧,有点像:)。


现在,如果我只想找到一种与我的实用程序进行交互的方式来自

Konqueror或Nautilus,作为 ;发送至 Windows资源管理器的功能

允许,我会更开心。 ;)感谢所有有这些自​​由许可证的优秀工具给你们的工程师。

I hope I don''t bore you with this personal experience. But, I hope
the details are helpful for other Python and/or Linux newbies, or for
those thinking about becoming such.

I have been using Python on Windows for a few years now. One of the
things that attracted me to Python was the fact that it offered the
possibility of learning to program in Linux wile not even using Linux.
I recognized a few years back that Linux would eventually be the
platform I would use, once it matured a little.

My first Python GUI toolkit to learn was wxPython, and I have nothing
but good things to say about it. But, after a while I began looking
for an ide to avoid some of the tedious aspects of coding the GUI. I
am still not completely settled on any one of them, but for some small
utilities that I''ve written I have enjoyed using PythonCard the best.
I have also heard great things about PyQt, however I have been
discouraged to try it since, on Windows, there is no GPL version (I
think that is a mistake on Trolltech''s part, but that is another
issue).

I recently received a copy of Mandrake 9.2 (included in the December
2003 issue of Linux Format magazine), so I decided to install it on a
test machine. Everything went smooth and it looks beautiful. It
comes with Python 2.3 already installed. I had a few minutes to
spare, so I decided to take a quick look at PyQt. I downloaded the
following rpms:

PyKDE-3.7-1mdk92.i586.rpm, PyQt-3.7-1mdk92.i586.rpm,
PyQt-devel-3.7-1mdk92.i586.rpm, libqscintilla2-1.1-1mdksbe.i586.rpm,
libqscintilla2-devel-1.1-1mdksbe.i586.rpm,
libsip10-3.7-mdk92.i586.rpm, libsip10-devel-3.7-mdk92.i586.rpm,
sip-3.7-mdk92.i586.rpm

As I said I only had a few minutes to spare. So when I ran into
trouble I did not take the time to chase to far for a solution. (I
thought things had installed well but Python would not find qt). As a
last resort I tried building PyQt from source, but it complained about
not finding Python.h. That led me to a post in C.L.P. that mentioned
that to install PyQt in Mandrake it was recommended to install a
separate copy of Python to use instead of the one shipped. My test
machine has a small (3GB) hard drive, so I decided to postpone that.

Having done that, I decided to try wxPython. I went to the site and
downloaded the rpm. Once downloaded, I simply right-clicked on it,
selected "Open with ...", and chose "Software Installer". It went in
without a hitch. I opened a terminal session to run Python, imported
wx, and it worked. I even tried coding a little wxPython YES_NO
dialog window, and there it was.

Encouraged by that success I downloaded the latest PythonCard rpm for
Mandrake. Again, it installed as smooth as wxPython did. It even
placed links for the Code and Resource Editors on the K menu. They
both worked well. I quickly copied one of my little PythonCard
programs from Windows. I used "Open With" to open the script in the
PythonCard Editor. I removed a couple of Windows specific calls,
saved it, and launched it. Wow, there it was. I was now Linux
programmer. Well, sort of :).

Now, if I could only figure out a way to interact with my utility from
Konqueror or Nautilus, as the "Send to" feature of Windows Explorer
allows, I will be even happier. ;) Thanks to all you coders that have
given us such great tools under such liberal licenses.

推荐答案

R. Marquez写道:
R.Marquez wrote:
现在,如果我只想找到一种与Konqueror或Nautilus的实用程序进行交互的方式,那就是发送到。 Windows资源管理器的功能
允许,我会更高兴。 ;)感谢所有在这种自由许可下给我们提供如此优秀工具的程序员。
Now, if I could only figure out a way to interact with my utility from
Konqueror or Nautilus, as the "Send to" feature of Windows Explorer
allows, I will be even happier. ;) Thanks to all you coders that have
given us such great tools under such liberal licenses.




在Konqueror下进入设置。您可以映射文件关联,

并为文件类型设置多个关联。输入py作为文件类型。


Stephen



Under Konqueror go under settings. You can map your file associations,
and have multiple associations for a file type. Type in "py" as file type.

Stephen


R.Marquez写道:
R.Marquez wrote:
我希望我不会厌倦这种个人经历。但是,我希望
这些细节对其他Python和/或Linux新手有用,或者对那些想要成为这样的人有用。

我一直在Windows上使用Python几年了。吸引我使用Python的其中一个原因是,它提供了学习在Linux中编程的可能性甚至不使用Linux。
几年前我认识到Linux会最终成为我将使用的平台,一旦它成熟了一点。

我要学习的第一个Python GUI工具包是wxPython,我什么都没有
但是好的话要说些什么它。但是,过了一段时间后,我开始寻找一个ide来避免编写GUI的一些繁琐的方面。我还没有完全确定他们中的任何一个,但对于我写的一些小的实用工具,我最喜欢使用PythonCard。
我也听过很多关于它的信息。 PyQt,但是我一直不鼓励尝试它,因为在Windows上没有GPL版本(我认为这是Trolltech的一个错误,但那是另一个
我最近收到了Mandrake 9.2的副本(包含在2003年12月的Linux Format杂志中),所以我决定将它安装在
测试机器上。一切顺利,看起来很漂亮。它已经安装了Python 2.3。我有几分钟的时间来备用,所以我决定快速浏览一下PyQt。我下载了以下rpms



不是Linux格式化!我非常喜欢每期都附带

的DVD(或2张CD)。我发现文章是一流的,并深入研究具体内容

的应用程序,实用程序,发行版,什么。我已经订阅了Linux Journal

多年,但与Linux格式相比,LJ是空心的。


BTW,你试过Boa-Constructor,a使用wxPython的GUI RAD开发工具?

PyKDE-3.7-1mdk92.i586.rpm,PyQt-3.7-1mdk92.i586.rpm,
PyQt-devel-3.7- 1mdk92.i586.rpm,libqscintilla2-1.1-1mdksbe.i586.rpm,
libqscintilla2-devel-1.1-1mdksbe.i586.rpm,
libsip10-3.7-mdk92.i586.rpm,libsip10-devel- 3.7-mdk92.i586.rpm,
sip-3.7-mdk92.i586.rpm

正如我所说,我只有几分钟的时间。所以,当我遇到麻烦时,我没有花时间去追求解决方案。 (我认为事情安装得很好,但Python找不到qt)。作为最后的手段,我尝试从源代码构建PyQt,但它抱怨没有找到Python.h。这导致我在C.L.P.的一个职位。提到要在Mandrake中安装PyQt,建议安装一个单独的Python副本来代替发送的。我的测试机器有一个小的(3GB)硬盘,所以我决定推迟。

完成后,我决定尝试wxPython。我去了网站并下载了rpm。下载后,我只需右键单击它,
选择打开方式...,然后选择软件安装程序。它毫无障碍地进入了
。我打开了一个终端会话来运行Python,导入了
wx,它运行起来了。我甚至尝试编写一个小的wxPython YES_NO
对话框窗口,就在那里。

为了成功而鼓励我为Mandrake下载了最新的PythonCard rpm。再次,它安装得像wxPython一样顺利。它甚至在K菜单上放置了代码和资源编辑器的链接。他们都运作良好。我很快从Windows复制了一个我的小PythonCard程序。我使用了打开方式和打开方式。在
PythonCard编辑器中打开脚本。我删除了几个Windows特定的电话,
保存并启动它。哇,就在那里。我现在是Linux
程序员。好吧,有点:)。

现在,如果我只能找到一种方式来与Konqueror或Nautilus的实用程序进行交互,那么就像发送到一样。 Windows资源管理器的功能
允许,我会更高兴。 ;)感谢所有在这种自由许可下给我们提供如此优秀工具的程序员。
I hope I don''t bore you with this personal experience. But, I hope
the details are helpful for other Python and/or Linux newbies, or for
those thinking about becoming such.

I have been using Python on Windows for a few years now. One of the
things that attracted me to Python was the fact that it offered the
possibility of learning to program in Linux wile not even using Linux.
I recognized a few years back that Linux would eventually be the
platform I would use, once it matured a little.

My first Python GUI toolkit to learn was wxPython, and I have nothing
but good things to say about it. But, after a while I began looking
for an ide to avoid some of the tedious aspects of coding the GUI. I
am still not completely settled on any one of them, but for some small
utilities that I''ve written I have enjoyed using PythonCard the best.
I have also heard great things about PyQt, however I have been
discouraged to try it since, on Windows, there is no GPL version (I
think that is a mistake on Trolltech''s part, but that is another
issue).

I recently received a copy of Mandrake 9.2 (included in the December
2003 issue of Linux Format magazine), so I decided to install it on a
test machine. Everything went smooth and it looks beautiful. It
comes with Python 2.3 already installed. I had a few minutes to
spare, so I decided to take a quick look at PyQt. I downloaded the
following rpms:
Isn''t Linux Format a hoot! I really love the DVD (or 2 CDs) that come with
every issue. I find the articles are first class and delve into specifics
for apps, utilities, distros, what ever. I''ve subscribed to Linux Journal
for years, but compared to Linux Format LJ is hollow.

BTW, Have you tried Boa-Constructor, a GUI RAD dev tool that uses wxPython?


PyKDE-3.7-1mdk92.i586.rpm, PyQt-3.7-1mdk92.i586.rpm,
PyQt-devel-3.7-1mdk92.i586.rpm, libqscintilla2-1.1-1mdksbe.i586.rpm,
libqscintilla2-devel-1.1-1mdksbe.i586.rpm,
libsip10-3.7-mdk92.i586.rpm, libsip10-devel-3.7-mdk92.i586.rpm,
sip-3.7-mdk92.i586.rpm

As I said I only had a few minutes to spare. So when I ran into
trouble I did not take the time to chase to far for a solution. (I
thought things had installed well but Python would not find qt). As a
last resort I tried building PyQt from source, but it complained about
not finding Python.h. That led me to a post in C.L.P. that mentioned
that to install PyQt in Mandrake it was recommended to install a
separate copy of Python to use instead of the one shipped. My test
machine has a small (3GB) hard drive, so I decided to postpone that.

Having done that, I decided to try wxPython. I went to the site and
downloaded the rpm. Once downloaded, I simply right-clicked on it,
selected "Open with ...", and chose "Software Installer". It went in
without a hitch. I opened a terminal session to run Python, imported
wx, and it worked. I even tried coding a little wxPython YES_NO
dialog window, and there it was.

Encouraged by that success I downloaded the latest PythonCard rpm for
Mandrake. Again, it installed as smooth as wxPython did. It even
placed links for the Code and Resource Editors on the K menu. They
both worked well. I quickly copied one of my little PythonCard
programs from Windows. I used "Open With" to open the script in the
PythonCard Editor. I removed a couple of Windows specific calls,
saved it, and launched it. Wow, there it was. I was now Linux
programmer. Well, sort of :).

Now, if I could only figure out a way to interact with my utility from
Konqueror or Nautilus, as the "Send to" feature of Windows Explorer
allows, I will be even happier. ;) Thanks to all you coders that have
given us such great tools under such liberal licenses.




-


-

GrayGeek



--

-
GrayGeek


GrayGeek写道:
GrayGeek wrote:
不是Linux格式化的!我非常喜欢每期都附带的DVD(或2张CD)。我发现文章是一流的,并深入研究应用程序,实用程序,发行版,以及任何有关的细节。我已经订阅了Linux Journal
多年,但与Linux格式相比,LJ是空洞的。


是的。 Linux格式非常出色(有点贵,但我想我/ b $ b会尝试一年)。我非常喜欢它。我觉得他们非常感兴趣,他们真正想要一个优质的产品,包括他们所包含的DVD / CD。他们的

网站上的论坛也是一个很好的补充。
顺便说一句,你有没有尝试过Boa-Constructor,一个使用wxPython的GUI RAD开发工具?
Isn''t Linux Format a hoot! I really love the DVD (or 2 CDs) that come with
every issue. I find the articles are first class and delve into specifics
for apps, utilities, distros, what ever. I''ve subscribed to Linux Journal
for years, but compared to Linux Format LJ is hollow.
Yes. Linux Format is outstanding (a little pricey, but I figured I
would try it for a year). I have enjoyed it tremendously. I sense a
good interest on their part in really geting a good quality product
out, including the DVD/CDs that they include. The forums on their
website is also a nice complement.
BTW, Have you tried Boa-Constructor, a GUI RAD dev tool that uses wxPython?




我给了它一个快速测试。但是,在

时间对我来说有点太复杂了。从我所看到的,我将不得不学习一种特殊的方式来组织我的代码,以便Boa可以使用它。对于

的例子,它似乎希望我在每个应用程序中都有一个main()方法。

这可能没关系,但我不觉得服用是时候学习

了。我也不喜欢它如何将代码喷入我的应用程序

,因为我添加了GUI组件。它让我想起了我第一次使用MS Front Page来编辑我的一些网页时的感觉(颤抖:)。

但是,我听说过那些努力正在改善其中的一部分。

所以,我可以再试一次。


另一方面,当我然后尝试了PythonCard,我立即以其简洁,清晰的代码以及从应用程序的其余部分优雅地分离了

GUI代码来销售
。你试过Python

卡吗?



I gave it a quick test. But, it was a little too complex for me at the
time. From what I could see, I would have had to learn a particular
way of organizing my code so that Boa could work with it. For
example, it seemed to want me to have a main() method in every app.
That may be Ok, but I didn''t feel like taking the time to learn that
at the time. I also didn''t like how it would spray code into my app
as I added GUI components. It reminded me of what I felt the first
time I used MS Front Page to edit some of my web pages (shudder :).
But, I''ve heard that efforts are on the way to improve some of that.
So, I may give it another try some time.

On the other hand, when I then tried PythonCard, I was immediately
sold on its simplicity, clarity of code, and elegant separation of the
GUI code from the rest of the application. Have you tried Python
Card?


这篇关于Linux GUI编程的第一印象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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