First Impressions of Linux GUI Programming

Discussion in 'Python' started by R.Marquez, Nov 12, 2003.

  1. R.Marquez

    R.Marquez Guest

    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, Nov 12, 2003
    #1
    1. Advertising

  2. 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
     
    Stephen Boulet, Nov 12, 2003
    #2
    1. Advertising

  3. R.Marquez

    GrayGeek Guest

    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
     
    GrayGeek, Nov 12, 2003
    #3
  4. R.Marquez

    R.Marquez Guest

    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?
     
    R.Marquez, Nov 13, 2003
    #4
  5. R.Marquez

    R.Marquez Guest

    > > 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.)
     
    R.Marquez, Nov 13, 2003
    #5
  6. R.Marquez

    Tim(PAS) Guest

    PÃ¥ 13 Nov 2003 12:32:10 -0800, skrev R.Marquez <>:

    >
    > 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/
     
    Tim(PAS), Nov 13, 2003
    #6
  7. R.Marquez

    GrayGeek Guest

    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
     
    GrayGeek, Nov 13, 2003
    #7
  8. R.Marquez

    John J. Lee Guest

    (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
     
    John J. Lee, Nov 14, 2003
    #8
  9. R.Marquez

    David Boddie Guest

    (R.Marquez) wrote in message news:<>...

    > 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/documentation/tutorials/dot/servicemenus.html

    David
     
    David Boddie, Nov 14, 2003
    #9
  10. R.Marquez

    R.Marquez Guest

    -and.ac.uk (David Boddie) wrote in message news:<>...
    > (R.Marquez) wrote in message news:<>...
    >
    > > 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/documentation/tutorials/dot/servicemenus.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.
     
    R.Marquez, Nov 15, 2003
    #10
  11. R.Marquez

    Mark Roach Guest

    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/edit-directory-listing.zip

    -Mark
     
    Mark Roach, Nov 21, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arsen V.

    Tracking High Volume of Impressions

    Arsen V., Jun 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    389
    Scott Allen
    Jun 21, 2004
  2. John Finney

    MapForce2004 impressions?

    John Finney, Sep 5, 2003, in forum: XML
    Replies:
    2
    Views:
    371
    John Finney
    Sep 6, 2003
  3. Anders J. Munch

    Relative import first impressions

    Anders J. Munch, Sep 23, 2006, in forum: Python
    Replies:
    0
    Views:
    298
    Anders J. Munch
    Sep 23, 2006
  4. Alf P. Steinbach
    Replies:
    4
    Views:
    804
  5. Sam Sungshik Kong

    My impressions about Ruby

    Sam Sungshik Kong, Jul 9, 2004, in forum: Ruby
    Replies:
    11
    Views:
    216
    durgaprasad guda
    Jul 10, 2004
Loading...

Share This Page