I have Python 3.2 on a windows 7 operating system. The other day I thought that it would be convenient to add a link to create a new .py file in the right hand click "new" menu. I had worked with the registry before and looked up how to add an item to the "new" menu, but when I got to the registry under HKEY_CLASSES_ROOT the .py extension key was not there. I only know how to add something to the "new" menu using the extension key. I searched the web, but could not come up with any other ways. Python works perfectly fine, and I don't want to mess anything up by adding the extension key. So here are my questions:

Will I mess up python or something else by adding a .py key?( I know it is dangerous to work with the registry, that is why I am looking for a safe solution) If not how can I go about doing this?


Is there a different way to add "create a new python file" to the "new" menu? If so how can I do it?


If the only way is very complicated should I forget about it?

Thank you in advance.

P.S I originally posted on Stack Overflow that they told me to move it over here.


1 Answer 1


The simplest way is probably to use the "new > text document" context menu item, change the name of the new file and add a .py extension.

To extend the explorer, you'll need a shell extension.

There is a free software configurable context menu available. Be careful with windows installers from sourceforge though. Word is that sourceforge now bundles adware with them!

Edit: Adding a new type to the context menu can indeed be done by fiddling with the registry.

  • 1
    He’s not asking about creating new context menus, he’s asking about adding an entry to the existing New→ menu.
    – Synetech
    Nov 10, 2013 at 15:48

Not the answer you're looking for? Browse other questions tagged .