How do I get this drag-and-drop behaviour back?
I just (finally!) upgraded Python from 2.6 to 2.7, and also installed 3.2 in parallel. I am running Windows Vista.
Before, I could drag-and-drop onto a .py file to run the script, with the dragged file's name appearing in sys.argv. I did nothing to get this behaviour; it worked as soon as Python 2.6 was installed.
It no longer works: the .py file is not recognized as a valid drop target.
I tried this registry hack, which I also found by searching on Google (getting a few scattered references, including an old mailing list thread on python.org). It accomplished exactly nothing, even after restarting the computer. I also shouldn't have to do this anyway, since I didn't have to last time.
What is going on? How can I fix it? I really miss having this behaviour.
41 Answer
Is it possible that this is a bitness problem, where you are using a 64-bit Explorer, but have installed the 32-bit version of python ? In this case the 64-bit Explorer may not work.
If you have installed Windows 64-bit, you can still test this theory by dropping a file on a .py script using the 32-bit Explorer, which is invoked using this command-line :
%Systemroot%\SysWOW64\explorer.exe /separate[EDIT]
Since you say that this is not the case, then I can only offer as workaround to compile the .py scripts to .exe by using a tool such as py2exe :
py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.
Question: Did you install python using its installer ?
3