0

While working with Django, I have to modify views.py and a variety of other files. What's bugging me is that I have to open these .py files through the python IDLE application every time and then modify them. However, if I try opening these python files directly from the directory in which they're located, some window which looks like the CMD prompt pops up and stays for 1 second or so, and I'm not able to edit the file in that way.

How do I take care of this situation?

2 Answers 2

1

What you are doing if you double-click is executing it, opening it in python directly. If you want to open it in IDLE, you have to right-click and select the IDLE-Application (you probably have to locate the exe file). You probably wanna tick the "use as default action" button to open it automatically next time you double click it.

0

What's bugging me is that I have to open these .py files through the Python IDLE application every time and then modify them.

You can use any text editor you like, so long as it appears in your right-click menu. Some, like Notepad++, will appear as their own entry and the rest will appear under the "Open With" sub-menu item.

If I try opening these Python files directly from the directory in which they're located, some window which looks like the CMD prompt pops up and stays for 1 second or so, and I'm not able to edit the file in that way.

If you aren't right-clicking them, then you are executing them (single or double left-click, depending on your Windows settings). You could (in theory) change the file association for these files (to make them automatically open in a specific text editor when double-clicked) but this would break any functionality for simple execution (i.e. at the very least, you would always be required to open a command window and run e.g. python somefile.py).

You must log in to answer this question.

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