|
⇤ ← Revision 1 as of 2011-05-02 03:32:39
Size: 651
Comment:
|
← Revision 2 as of 2011-05-02 20:35:50 ⇥
Size: 2273
Comment: Attempted to answer the question, tidying it up a bit.
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 4: | Line 4: |
| = Asking for Help: ... = | = Asking for Help: How come when I double click on a .py a black thing flashes and then disappears? And what/where exactly is the 'Python Interpreter'? = |
| Line 6: | Line 6: |
| ... | It seems like you're using Windows from the question. The "black thing" is called a "console", "command line prompt" or "terminal" depending on which person you ask, and it's the "advanced" way of accessing the programs and files on your computer. Usually you don't see it unless you go into the "Start" menu and find it, but Python programs ending in `.py` cause it to open while they are running because the program might write out some text, and the console is the standard way of showing such text - this dates back to the time of MS-DOS, but other systems also use the same kind of thing. |
| Line 8: | Line 8: |
| ## Insert your problem description here. You may provide code samples using syntax like this: ## {{{#!python ## ... ## }}} |
The console appears and disappears because the program finishes, possibly very quickly, and you don't get to see the messages produced by the program. It may be the case that the program needed to be run in a particular way and complained before exiting straight away and leaving you without any lasting indication of why it exited. Some programs should actually be started in the console so that you can see such messages and possibly interact with them using the keyboard in a basic text-only fashion. |
| Line 13: | Line 10: |
| ## Leave the note below so that editors can follow the instructions... | Many programs are designed to work normally when double-clicking on a `.py` file and may produce a graphical interface with windows and icons, just like "normal" Windows applications. In such cases, opening the console is a distraction and unnecessary. On Windows, such programs usually have the `.pyw` ending on their filenames, indicating that the console is not supposed to be opened when the program is run. You could rename `.py` programs to end with `.pyw`, but it might be worth finding the instructions for such programs and seeing how they are supposed to be used first. |
| Line 15: | Line 12: |
| {{{#!wiki note When ''answering'' questions, add the CategoryAskingForHelpAnswered category when saving the page. This will move the link to this page from the questions section to the answers section on the [[Asking for Help]] page. }}} |
As for the Python interpreter, it is the software which understands Python code (in the `.py` and `.pyw` files) and makes it work. On Windows, the interpreter software is typically found somewhere in the Program Files folder. |
| Line 20: | Line 15: |
| CategoryAskingForHelp | CategoryAskingForHelp CategoryAskingForHelpAnswered |
Asking for Help: How come when I double click on a .py a black thing flashes and then disappears? And what/where exactly is the 'Python Interpreter'?
It seems like you're using Windows from the question. The "black thing" is called a "console", "command line prompt" or "terminal" depending on which person you ask, and it's the "advanced" way of accessing the programs and files on your computer. Usually you don't see it unless you go into the "Start" menu and find it, but Python programs ending in .py cause it to open while they are running because the program might write out some text, and the console is the standard way of showing such text - this dates back to the time of MS-DOS, but other systems also use the same kind of thing.
The console appears and disappears because the program finishes, possibly very quickly, and you don't get to see the messages produced by the program. It may be the case that the program needed to be run in a particular way and complained before exiting straight away and leaving you without any lasting indication of why it exited. Some programs should actually be started in the console so that you can see such messages and possibly interact with them using the keyboard in a basic text-only fashion.
Many programs are designed to work normally when double-clicking on a .py file and may produce a graphical interface with windows and icons, just like "normal" Windows applications. In such cases, opening the console is a distraction and unnecessary. On Windows, such programs usually have the .pyw ending on their filenames, indicating that the console is not supposed to be opened when the program is run. You could rename .py programs to end with .pyw, but it might be worth finding the instructions for such programs and seeing how they are supposed to be used first.
As for the Python interpreter, it is the software which understands Python code (in the .py and .pyw files) and makes it work. On Windows, the interpreter software is typically found somewhere in the Program Files folder.
