July 5th, 2012, 08:28 PM
I don't know what "on Eclipse" means. It might be important.
Suppose I put your program into the file p.py in my current directory. This is how I start python, load your code, and run it:
Python 2.7.3 (default, Apr 20 2012, 22:39:59)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import p
Or you might heed this advice:
| June 27th, 2012, 10:33 AM |
Join Date: Feb 2005
Time spent in forums: 2 Days 12 h 26 m 48 sec
Reputation Power: 26
You would be much better off to paste the code into the editor of an IDE (Integrated Development Environment) like IDLE and run (press F5 key) it from there.
You can find IDLE for instance in:
Comments on this post
cheekychives agrees: Very helpful.
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
Last edited by Dietrich : June 27th, 2012 at 10:35 AM.
[/code] are essential for python code!