473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

First Impressions of Linux GUI Programming

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.
Jul 18 '05 #1
10 2475
R.Marquez wrote:
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.


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

Jul 18 '05 #2
R.Marquez wrote:
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
Jul 18 '05 #3
GrayGeek wrote:
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?


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?
Jul 18 '05 #4
> > 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. ;)


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,
What I mean is that, in Windows Explorer, I am able to select a few
arbitrary files and/or directories, right click on them and send them
to an app as parameters. That way, the app could perform a certain
job on each one of the selected files. I've now heard that I'll have
to wait until KDE 3.2 comes out to be able to do this, since it will
allow one to define custom context menu
entries. I just hope that I will be able to easily write them through
Python. (I wonder if GNOME will have something similar.)
Jul 18 '05 #5
PÃ¥ 13 Nov 2003 12:32:10 -0800, skrev R.Marquez <ny**********@yahoo.com>:

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?


You could also check out the FLTK GUI toolkit with the pyFLTK wrapper. FLTK
comes with a nice and easy GUI builder and the pyFLTK tool flconvert
converts it to python code.

Check it out on:

FLTK: http://www.fltk.org/
pyfltk: http://pyfltk.sourceforge.net/index.html

Best regards
Tim R.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Jul 18 '05 #6
R.Marquez wrote:
GrayGeek wrote:
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?


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?


I've downloaded it but haven't installed it. Boa-Constructor is easy IF
you've had experience with other GUI RAD Dev tools like VB, KDevelop,
Kylix, etc., otherwise the learning curve can be steep.
--

-
GrayGeek
Jul 18 '05 #7
ny**********@yahoo.com (R.Marquez) writes:
[...]
What I mean is that, in Windows Explorer, I am able to select a few
arbitrary files and/or directories, right click on them and send them
to an app as parameters. That way, the app could perform a certain
job on each one of the selected files. I've now heard that I'll have
to wait until KDE 3.2 comes out to be able to do this, since it will
allow one to define custom context menu

[...]

I never use Konqueror as a file browser, only as a web browser, but
I'm already running 3.2 and it's not particularly unstable. I've had
a few more crashes of Konqueror than with 3.0, but that's all.

It's easy to compile, and once you check out of CVS with cvsup (no,
not "cvs up", "cvsup" is a file syncing app that takes advantage of
CVS amongst other protocols), you can easily update to the final
release when it comes out. Just follow the KDE cvsup instructions
(google for them), with the modifications that:

1. You have to click the little green arrow in cvsup to start the
thing downloading. I failed to notice that :-)

2. There are a few more i18n modules added since the KDE cvsup page
was written, so you need them in the file that tells cvsup which
i18n modules not to download (and you need to read the cvsup FAQ to
figure out where to put that file)

3. Remember to compile in the order: arts, kdelibs, kdebase, then
anything else.

4. If you don't know how your kdm / xdm / gdm configuration works,
that can admittedly be a major pain.
John
Jul 18 '05 #8
ny**********@yahoo.com (R.Marquez) wrote in message news:<8a**************************@posting.google. com>...
What I mean is that, in Windows Explorer, I am able to select a few
arbitrary files and/or directories, right click on them and send them
to an app as parameters. That way, the app could perform a certain
job on each one of the selected files. I've now heard that I'll have
to wait until KDE 3.2 comes out to be able to do this, since it will
allow one to define custom context menu
entries. I just hope that I will be able to easily write them through
Python. (I wonder if GNOME will have something similar.)


Is the following URL at all helpful or is the interface too inflexible?

http://developer.kde.org/documentati...vicemenus.html

David
Jul 18 '05 #9
da****@mcs.st-and.ac.uk (David Boddie) wrote in message news:<4d**************************@posting.google. com>...
ny**********@yahoo.com (R.Marquez) wrote in message news:<8a**************************@posting.google. com>...
What I mean is that, in Windows Explorer, I am able to select a few
arbitrary files and/or directories, right click on them and send them
to an app as parameters. That way, the app could perform a certain
job on each one of the selected files. I've now heard that I'll have
to wait until KDE 3.2 comes out to be able to do this, since it will
allow one to define custom context menu
entries. I just hope that I will be able to easily write them through
Python. (I wonder if GNOME will have something similar.)


Is the following URL at all helpful or is the interface too inflexible?

http://developer.kde.org/documentati...vicemenus.html

David


Wow! That works very well.

In Windows, there is a limmitation on the "Send to" functionality that
only allows about 512 characters to be passed on. So if the file path
is deep or if there are a lot of files, Windows complains with a (very
misleading) error.

However, in KDE I configured a Service Menu for one of my little
utilities that accepts files and directories as parameters, and I was
able to pass 1569 items to it without a problem. I love it! Thank
you very much for the tip.
Jul 18 '05 #10
On Thu, 13 Nov 2003 12:51:43 -0800, R.Marquez wrote:
What I mean is that, in Windows Explorer, I am able to select a few
arbitrary files and/or directories, right click on them and send them
to an app as parameters. That way, the app could perform a certain
job on each one of the selected files. I've now heard that I'll have
to wait until KDE 3.2 comes out to be able to do this, since it will
allow one to define custom context menu
entries. I just hope that I will be able to easily write them through
Python. (I wonder if GNOME will have something similar.)


Here is a trivial example of having a context menu item for a specific
content type in nautilus (using python)...
http://okmaybe.com:8000/~mrroach/edi...ry-listing.zip

-Mark
Jul 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: DotNetIsHorrible | last post by:
I write CRUD database applications for a living for an audience of about 100 users per application using classic ASP. I maintain and frequently change on user's request 22 different applications...
2
by: Arsen V. | last post by:
Hello, Did anyone have some experience with the following: 1) Need to track high volume of impressions - 20,000,000+ per day 2) Backend is SQL Server 2000 3) Webfarm of IIS with ASP.NET 4)...
17
by: Nirjhar Oberoi | last post by:
Hi, I am new to Linux and wanted to know how to use GCC to Compile the Code written in C? I dont want to use EMacs or VI for my editor. Can you suggest a good IDE for linux for C Programming.. ...
12
by: Magesh | last post by:
Can anyone suggest me a good book to learn C/C++ programming under Linux platform?
29
by: jmDesktop | last post by:
For students 9th - 12th grade, with at least Algebra I. Do you think Python is a good first programming language for someone with zero programming experience? Using Linux and Python for first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.