pythoneclipsepydev

Pydev, shortcut for inserting if __name__ == '__main__' in code


Is there shortcut or quicker way in Pydev to insert if __name__ == '__main__' ?


Solution

  • PyDev is based on Eclipse platform and all Eclipse tricks work there.

    You can create your own shortcut templates for autocompletion.

    E.g. if you type main[ctrl+space] it completes to if __name__ == "__main__".

    More information how to create custom Eclipse templates:

    https://dzone.com/articles/effective-eclipse-custom-templ