Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Updated Autocomplete for Python 3

    Help wanted · · · – – – · · ·
    4
    4
    2090
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Noah Black
      Noah Black last edited by

      I’ve been using NPP as my Python editor ever since I started learning it. I first learned Python 2.7, and NPP has support for Python 2.7’s syntax, and hints on what functions do when I typing them (like telling me what parameters I need). This was all very helpful when learning, and is something I still appreciate.

      However, I have recently updated to Python 3.7, and there are some changes between these versions. NPP still gives me suggestions as though I’m using Python 2.7, even though I don’t even have it installed on my computer anymore.

      This is best seen when getting user input. In Python 2.7, input() was a function that would only accept and return integers as input, and raw_input() was a function that would accept any input because it would be returned as a string.
      In Python 3.7, there is no such function as raw_input(). It was removed, and now input() uses strings instead of integers.
      However, NPP still tells me that input() returns an integer (in a round-a-bout sort of way) and that a function called raw_input() exists and returns a string.

      How do I make NPP give suggestions for Python 3 instead of Python 2?

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse last edited by

        The autoComplete files are available within autoCompletion directory.
        The file you are looking for is called python.xml.
        In addition you might add/change the langs.xml file, or in case you use a theme different to default theme the THEME_NAME.xml from theme directory, in order to get the new keywords.
        Note, adding keywords can also be done by using the gui
        Settings->Style Configurator->Language(Python)->Style(KEYWORDS)

        1 Reply Last reply Reply Quote 1
        • PeterJones
          PeterJones last edited by

          @Ekopalypse gave a good starting place. If you’d like more details, see the Notepad++ UserManaual, especially:

          • auto-completion
          • langs.xml details
          • themes.xml details and the themes overview
          1 Reply Last reply Reply Quote 1
          • Alan Kilborn
            Alan Kilborn @Noah Black last edited by

            @Noah-Black

            There was also a recent issue filed regarding this: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/6259 “Fix keywords list according to Python 3”

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors