Forcing Python mode on some files?

Sep 7, 2011 at 4:15 PM

I've found information on editing the registry to add more extensions to be recognized as Python by MSVC, but I really have a lot of files with various extensions that are in Python and that's going to be tedious. Is there a way to 'force' python mode?

Could PTVS recognize the usual syntaxes at the head of files that are used to indicate the language? ( # -*- python -*- )

Coordinator
Sep 8, 2011 at 3:37 AM

There's an issue on this open: http://pytools.codeplex.com/workitem/501

Unfortunately it's not very easy as VS is pretty heavily based upon extension -> content type mapping.  I'm looking into this and have pinged some VS people for help.  We are largely in charge of opening files when they're in a project so if I can figure out how to get past the file extension mapping then I think we'd be able to use any scheme to recognize files that were in a Python project.