Welcome, guest | Sign In | My Account | Store | Cart

If you use the command prompt here powertoy, you might find this useful. Right click on any folder and select Python Shell Here, and an that opens up in the directory you selected.

Python, 7 lines
1
2
3
4
5
6
7
PyShellHere.bat:
cd %1
python


Registry edit:
You need to add a new key in 'My Computer\HKEY_CLASSES_ROOT\Folder\shell' named 'Python Shell Here', and under that a key named 'command' with a REG_SZ value that points to your batch file and follows it with a reference to the %L variable. On my machine, this full value looks like this: "c:\utils\PyShellHere.cmd" "%L" (all quotes included).

Adapted from "http://www.executableabstractions.com/weblog/Python/2004/03/17.html#P40"

1 comment

Jason Whitlark (author) 19 years, 7 months ago  # | flag

Oops... This obviously only works on windows, but I should have mentioned it anyway.

Created by Jason Whitlark on Mon, 30 Aug 2004 (PSF)
Python recipes (4591)
Jason Whitlark's recipes (4)

Required Modules

  • (none specified)

Other Information and Tasks