Results 1 to 4 of 4

Thread: Can't get .py files to open in gedit

  1. #1
    Join Date
    Apr 2009
    Beans
    300
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Can't get .py files to open in gedit

    I would like to be able to edit my .py source files with a text editor. However when I right click the icon in Nautilus, select properties -> open with, and add Text Editor it has no effect. If I select it and click the reset button it adds Notepad (Wine installed) to the list but otherwise has no effect. How can I get my .py files to open in gedit?

    BTW I never want to use Notepad for anything at all. Is there a way I can keep it from being added as an 'open with' application?

    Edit: The problem has to do with the executable bit being set. I wish there was a way around this. When I execute I do it from the command line but most always I edit a script after browsing in Nautilus.
    Last edited by donsy; August 6th, 2011 at 09:51 PM.

  2. #2
    Join Date
    Sep 2009
    Location
    Canada, Montreal QC
    Beans
    1,809
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Can't get .py files to open in gedit

    So when you double click it, does it present a dialog with the Display option in it?

    I think your file association may need a little tweaking.
    I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.
    Freedom is measured in Stallmans.
    Projects: gEcrit

  3. #3
    Join Date
    Apr 2009
    Beans
    300
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Can't get .py files to open in gedit

    Quote Originally Posted by cgroza View Post
    So when you double click it, does it present a dialog with the Display option in it?
    This reminded me of the behavior I had set in Nautilus. Under preferences -> behavior I had it set to "Run executable text files when they are clicked". I changed this to "View ..." and problem solved. Thanks.

  4. #4
    Join Date
    Jul 2010
    Location
    51.508056, -0.128056
    Beans
    205
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get .py files to open in gedit

    Quote Originally Posted by donsy View Post

    BTW I never want to use Notepad for anything at all. Is there a way I can keep it from being added as an 'open with' application?
    Go to ~/.local/share/applications/wine. You should find a lot of Wine related 'shortcuts' there. Delete the ones that belong to Notepad (there may be multiple) and Notepad should no longer appear in your list. Another way is to right click on the Applications menu, edit, then go to 'other', and start removing all the notepad entries.

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
  •