Results 1 to 4 of 4

Thread: Autorun python script IN TERMINAL after login?

  1. #1
    Join Date
    Nov 2012
    Beans
    3

    Autorun python script IN TERMINAL after login?

    I created a python script and I've made it executable so I can click on it and it asks. Is there a way to make it default to automatically run after double clicking on it? I've been also trying to make it run after logging in, but the autostart feature doesn't seem work. Do I need to put it in a bash script or something else?

  2. #2
    Join Date
    Nov 2012
    Beans
    3

    Re: Autorun python script IN TERMINAL after login?

    I think I'm getting there...

    I installed this:

    sudo apt-get install gnome-panel

    Then did this:

    gnome-desktop-item-edit ~/Desktop/ --create-new

    Now I have a desktop icon that starts it without prompting me to edit. But I tried putting it in the startup applications and it opens in gedit after logging in.

  3. #3
    Join Date
    Nov 2008
    Location
    S.H.I.E.L.D. 6-1-6
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Autorun python script IN TERMINAL after login?

    a)Make sure it has executable permissions
    b) Add
    Code:
    #!/usr/bin/python
    to the very top of the script

    Then, launch the script using gnome-terminal
    Code:
     gnome-terminal -x /path/to/script
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

  4. #4
    Join Date
    Nov 2012
    Beans
    3

    Re: Autorun python script IN TERMINAL after login?

    Quote Originally Posted by sandyd View Post
    a)Make sure it has executable permissions
    b) Add
    Code:
    #!/usr/bin/python
    to the very top of the script

    Then, launch the script using gnome-terminal
    Code:
     gnome-terminal -x /path/to/script
    That worked great!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •