[Tutor] Opening .py files in firefox

Alan Gauld alan.gauld at freenet.co.uk
Mon Mar 20 00:29:01 CET 2006


> computer) using firefox, it gives me two options: running the script
> with the default Python app, or saving the file.  What I would like is
> to display the file as text in the browser.  

Open Tools->Folder Options in Windows explorer

Go to File Types tab

Scroll down to find .py (and .pyw)

Click Advanced button

Click New...

type Display in Action box (or whatever menu entry you want to use)

Use browser to locate the Firefox executable

OK back out.

Now right click a python file and you should see a Display entry 
that opens the code in the browser.

If the browser tries to execute the script you will need to go to 
the file types setting in the browser and set .py to plain-text. 
But I didn't need to do that.

HTH,

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld















More information about the Tutor mailing list