I've seen the question asked before on other sites, but never saw an acceptable answer. Just starting out in Python (like JUST as in 5 minutes ago). Running Python 3.0 on Windows XP. Now, the Hello World program. Here is exactly what i type in IDLE 3.0....:
>>> #!/usr/bin/python
>>> #Filename: helloworld.py
>>>
>>>print('Hello World')
Now, If I hit enter from here directly, I get the following line giving me the output of:
Hello World
>>>
So, at this point, I am assuming the program is running correctly. The problem comes next. From here, I save the file as helloworld.py...... I close IDLE 3.0. Re-open it. I then open the helloworld.py file, which appears in a new IDLE window. I then go to Run, and then Run Module. Then, all that happens is a warning box appears with "invalid syntax." WHY DOES THIS KEEP HAPPENING?!
Just a note that probably isnt important. The only way I can get the RUN menu to appear in IDLE is to close IDLE after the program is saved, reopen IDLE, File then Open, which opens the program in a new IDLE window (kinda pointless dont you think?). At this point, the newly opened IDLE window displays the RUN menu at the top.
Well, this darn message board keeps Automerging my post when I try to reply to this, so be aware of the following:
Answered my own question here. Problem has been solved. But this leads me to a new question. IDLE is the Python Shell obviously. When selecting File>Open New Window.... is the New Window the only place that programs should be typed in? Is the shell just for displaying output? Am I even asking an accurate question here or am I just totally missing some obvious point?
>>> #!/usr/bin/python
>>> #Filename: helloworld.py
>>>
>>>print('Hello World')
Now, If I hit enter from here directly, I get the following line giving me the output of:
Hello World
>>>
So, at this point, I am assuming the program is running correctly. The problem comes next. From here, I save the file as helloworld.py...... I close IDLE 3.0. Re-open it. I then open the helloworld.py file, which appears in a new IDLE window. I then go to Run, and then Run Module. Then, all that happens is a warning box appears with "invalid syntax." WHY DOES THIS KEEP HAPPENING?!
Just a note that probably isnt important. The only way I can get the RUN menu to appear in IDLE is to close IDLE after the program is saved, reopen IDLE, File then Open, which opens the program in a new IDLE window (kinda pointless dont you think?). At this point, the newly opened IDLE window displays the RUN menu at the top.
Well, this darn message board keeps Automerging my post when I try to reply to this, so be aware of the following:
Answered my own question here. Problem has been solved. But this leads me to a new question. IDLE is the Python Shell obviously. When selecting File>Open New Window.... is the New Window the only place that programs should be typed in? Is the shell just for displaying output? Am I even asking an accurate question here or am I just totally missing some obvious point?