Python, Linux, Desktop Environment

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jeremyvoros@gmail.com

    #1

    Python, Linux, Desktop Environment

    So, I've written my first GUI app in python. I've turned it into a
    binary .exe and .app that runs on Windows and Mac respectively, but on
    my Linux box, where I wrote the thing, I still have to drop to the
    command line and ./myscript.py. What can I do to make it a "click and
    run" sort of application in KDE or Gnome on Linux?

  • bruno at modulix

    #2
    Re: Python, Linux, Desktop Environment

    jeremyvoros@gma il.com wrote:[color=blue]
    > So, I've written my first GUI app in python. I've turned it into a
    > binary .exe and .app that runs on Windows and Mac respectively, but on
    > my Linux box, where I wrote the thing, I still have to drop to the
    > command line and ./myscript.py. What can I do to make it a "click and
    > run" sort of application in KDE or Gnome on Linux?[/color]

    There are *no* "click and run" on linux, since the GUI is an option,
    not a part of the OS.

    What you're looking for is WM/DesktopManager specific. You'll find the
    answers in the Gnome and KDE manuals.


    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in 'onurb@xiludom. gro'.split('@')])"

    Comment

    • bruno at modulix

      #3
      Re: Python, Linux, Desktop Environment

      jeremyvoros@gma il.com wrote:[color=blue]
      > So, I've written my first GUI app in python. I've turned it into a
      > binary .exe and .app that runs on Windows and Mac respectively, but on
      > my Linux box, where I wrote the thing, I still have to drop to the
      > command line and ./myscript.py. What can I do to make it a "click and
      > run" sort of application in KDE or Gnome on Linux?[/color]

      There are *no* "click and run" on linux, since the GUI is an option,
      not a part of the OS.

      What you're looking for is WM/DesktopManager specific. You'll find the
      answers in the Gnome and KDE manuals.


      --
      bruno desthuilliers
      python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
      p in 'onurb@xiludom. gro'.split('@')])"

      Comment

      • Yves Glodt

        #4
        Re: Python, Linux, Desktop Environment

        [color=blue]
        > jeremyvoros@gma il.com wrote:
        >[color=green]
        >> So, I've written my first GUI app in python. I've turned it into a
        >> binary .exe and .app that runs on Windows and Mac respectively, but on
        >> my Linux box, where I wrote the thing, I still have to drop to the
        >> command line and ./myscript.py. What can I do to make it a "click and
        >> run" sort of application in KDE or Gnome on Linux?
        >>[/color][/color]
        I don't really understand what you mean... Have you tried simply
        creating a "shortcut"
        that points to your script.py?
        That should make it run with a click...


        HTH,
        Yves

        Comment

        • Yves Glodt

          #5
          Re: Python, Linux, Desktop Environment

          [color=blue]
          > jeremyvoros@gma il.com wrote:
          >[color=green]
          >> So, I've written my first GUI app in python. I've turned it into a
          >> binary .exe and .app that runs on Windows and Mac respectively, but on
          >> my Linux box, where I wrote the thing, I still have to drop to the
          >> command line and ./myscript.py. What can I do to make it a "click and
          >> run" sort of application in KDE or Gnome on Linux?
          >>[/color][/color]
          I don't really understand what you mean... Have you tried simply
          creating a "shortcut"
          that points to your script.py?
          That should make it run with a click...


          HTH,
          Yves

          Comment

          • Jorgen Grahn

            #6
            Re: Python, Linux, Desktop Environment

            On Wed, 16 Nov 2005 19:56:51 +0100, bruno at modulix <onurb@xiludom. gro> wrote:[color=blue]
            > jeremyvoros@gma il.com wrote:[color=green]
            >> So, I've written my first GUI app in python. I've turned it into a
            >> binary .exe and .app that runs on Windows and Mac respectively, but on
            >> my Linux box, where I wrote the thing, I still have to drop to the
            >> command line and ./myscript.py. What can I do to make it a "click and
            >> run" sort of application in KDE or Gnome on Linux?[/color]
            >
            > There are *no* "click and run" on linux, since the GUI is an option,
            > not a part of the OS.
            >
            > What you're looking for is WM/DesktopManager specific. You'll find the
            > answers in the Gnome and KDE manuals.[/color]

            Yeah, and please don't accidentally remove the option to type 'myscript.py'
            on the command line -- that's how I almost always start GUI programs. If I
            like them enough, I edit my window manager's config so that it appears in a
            suitable place in the menus. Nine applications have made that list during
            the past fifteen years ;-)

            /Jorgen

            --
            // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
            \X/ snipabacken.dyn dns.org> R'lyeh wgah'nagl fhtagn!

            Comment

            • Jorgen Grahn

              #7
              Re: Python, Linux, Desktop Environment

              On Wed, 16 Nov 2005 19:56:51 +0100, bruno at modulix <onurb@xiludom. gro> wrote:[color=blue]
              > jeremyvoros@gma il.com wrote:[color=green]
              >> So, I've written my first GUI app in python. I've turned it into a
              >> binary .exe and .app that runs on Windows and Mac respectively, but on
              >> my Linux box, where I wrote the thing, I still have to drop to the
              >> command line and ./myscript.py. What can I do to make it a "click and
              >> run" sort of application in KDE or Gnome on Linux?[/color]
              >
              > There are *no* "click and run" on linux, since the GUI is an option,
              > not a part of the OS.
              >
              > What you're looking for is WM/DesktopManager specific. You'll find the
              > answers in the Gnome and KDE manuals.[/color]

              Yeah, and please don't accidentally remove the option to type 'myscript.py'
              on the command line -- that's how I almost always start GUI programs. If I
              like them enough, I edit my window manager's config so that it appears in a
              suitable place in the menus. Nine applications have made that list during
              the past fifteen years ;-)

              /Jorgen

              --
              // Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
              \X/ snipabacken.dyn dns.org> R'lyeh wgah'nagl fhtagn!

              Comment

              • Lee Harr

                #8
                Re: Python, Linux, Desktop Environment

                On 2005-11-16, jeremyvoros@gma il.com <jeremyvoros@gm ail.com> wrote:[color=blue]
                > So, I've written my first GUI app in python. I've turned it into a
                > binary .exe and .app that runs on Windows and Mac respectively, but on
                > my Linux box, where I wrote the thing, I still have to drop to the
                > command line and ./myscript.py. What can I do to make it a "click and
                > run" sort of application in KDE or Gnome on Linux?
                >[/color]


                Have you heard of a "shebang line"?

                That is when the first line of a file starts with #!

                You probably want ...

                #!/usr/bin/env python


                That will run the commandline from that first line.
                Remember, it must be the very first thing (no spaces).


                You may also need to be in a particular directory in
                order to access program resources. I usually end up
                making a little .sh script like ...

                #!/bin/sh

                cd /my/python/prog/dir && python myprog.py



                Most of the recent window managers are using the
                so called .desktop files. You could copy one of
                those from another program (try creating a "link
                to application" or an "applicatio n launcher" on
                your desktop).

                I think most wms will also just run your shell
                script if the permissions are set correctly.

                Comment

                • Lee Harr

                  #9
                  Re: Python, Linux, Desktop Environment

                  On 2005-11-16, jeremyvoros@gma il.com <jeremyvoros@gm ail.com> wrote:[color=blue]
                  > So, I've written my first GUI app in python. I've turned it into a
                  > binary .exe and .app that runs on Windows and Mac respectively, but on
                  > my Linux box, where I wrote the thing, I still have to drop to the
                  > command line and ./myscript.py. What can I do to make it a "click and
                  > run" sort of application in KDE or Gnome on Linux?
                  >[/color]


                  Have you heard of a "shebang line"?

                  That is when the first line of a file starts with #!

                  You probably want ...

                  #!/usr/bin/env python


                  That will run the commandline from that first line.
                  Remember, it must be the very first thing (no spaces).


                  You may also need to be in a particular directory in
                  order to access program resources. I usually end up
                  making a little .sh script like ...

                  #!/bin/sh

                  cd /my/python/prog/dir && python myprog.py



                  Most of the recent window managers are using the
                  so called .desktop files. You could copy one of
                  those from another program (try creating a "link
                  to application" or an "applicatio n launcher" on
                  your desktop).

                  I think most wms will also just run your shell
                  script if the permissions are set correctly.

                  Comment

                  • jeremyvoros@gmail.com

                    #10
                    Re: Python, Linux, Desktop Environment

                    Thanks everyone.

                    Making a shortcut was just too obvious for me...

                    I just made a KDE shortcut that runs the python command for me.

                    Comment

                    • jeremyvoros@gmail.com

                      #11
                      Re: Python, Linux, Desktop Environment

                      Thanks everyone.

                      Making a shortcut was just too obvious for me...

                      I just made a KDE shortcut that runs the python command for me.

                      Comment

                      • Florian Diesch

                        #12
                        Re: Python, Linux, Desktop Environment

                        jeremyvoros@gma il.com <jeremyvoros@gm ail.com> wrote:[color=blue]
                        > So, I've written my first GUI app in python. I've turned it into a
                        > binary .exe and .app that runs on Windows and Mac respectively, but on
                        > my Linux box, where I wrote the thing, I still have to drop to the
                        > command line and ./myscript.py. What can I do to make it a "click and
                        > run" sort of application in KDE or Gnome on Linux?[/color]

                        If you can start it from command line, you can start it from any menu
                        etc. As it's not Python related your favourite Linux newsgroup/mailing
                        list/user group/... should be a better place to ask.
                        Maybe <http://www.opendesktop .org> is helpfull too.



                        Florian
                        --
                        Einen Troll zu füttern ist das gleiche als würde man einen Haufen
                        Hundescheisse sehen, absichtlich reinsteigen und sich dann beschweren.
                        (Christian Schneider in <2005-10-25T10-04-37@bofh.my-fqdn.de>)

                        Comment

                        • Florian Diesch

                          #13
                          Re: Python, Linux, Desktop Environment

                          jeremyvoros@gma il.com <jeremyvoros@gm ail.com> wrote:[color=blue]
                          > So, I've written my first GUI app in python. I've turned it into a
                          > binary .exe and .app that runs on Windows and Mac respectively, but on
                          > my Linux box, where I wrote the thing, I still have to drop to the
                          > command line and ./myscript.py. What can I do to make it a "click and
                          > run" sort of application in KDE or Gnome on Linux?[/color]

                          If you can start it from command line, you can start it from any menu
                          etc. As it's not Python related your favourite Linux newsgroup/mailing
                          list/user group/... should be a better place to ask.
                          Maybe <http://www.opendesktop .org> is helpfull too.



                          Florian
                          --
                          Einen Troll zu füttern ist das gleiche als würde man einen Haufen
                          Hundescheisse sehen, absichtlich reinsteigen und sich dann beschweren.
                          (Christian Schneider in <2005-10-25T10-04-37@bofh.my-fqdn.de>)

                          Comment

                          Working...