Ok I am confused. I just started python and when I save my program that I edited in the IDE editor as for example helloworld.py I cannot run it when I click it. All it does it come up with a black box, like cmd, and dissappears. Also do you have to have python to run your program? Say you make some kind of software do you have to have python? Also what is the difference between the python shell in IDE and the editor in IDE. Also what is the Python (command line) for and why do you need it?

Recommended Answers

All 4 Replies

Some of the answers are contained in the thread called "Starting Python" just above this thread.

If you run your program from the IDE editor than you should see the result in the output window. In Windows, if you double click on the saved .py file, then python.exe gets invoked and the result shows up in the old white on black cmd window. To see the result, you have to add a line to the end of your program that makes cmd wait for a key stroke. Something like that:

print "Hello truculent World!"

raw_input("Press any key ...")   # wait for key stroke

Python has to be installed on any computer you want to run your code on! One way around this requirement is to package your program with a free program called Py2Exe that creates an .exe file that includes the needed modules and the interpreter. That's more for people that want to distribute commercial programs.

The Python shell has a >>> prompt and is only used to test short code samples. It is ugly and confusing at best, I only use it for things like help("os"). If you run Python.exe you get the >>> shell in the old sinister cmd window, disgusting! Use an IDE editor to write, save and run your programs! IDEs like IDLE invoke Pythonw.exe, and pipe the result to their own more pleasant output window.

Have fun with Python, it is an easy to read and very powerful computer language!

commented: thanks for the help +2

Thank you very much. I appreciate your time, but I looked in the above thread 'Starting Python' and I still did not find out what the Python (command line).

Thank you very much. I appreciate your time, but I looked in the above thread 'Starting Python' and I still did not find out what the Python (command line).

Can you tell me more details what you want to know about Python (command line). I haven't caught on yet!

Can you tell me more details what you want to know about Python (command line). I haven't caught on yet!

Nevermind. My question wasn't good. You answered everything your first post. Thank you again for helping me finding out an awesome language and something I really enjoy learning and coding.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.