Definite Newbie Question....

Robert Cragie rcc at nospamthanks_jennic.com
Fri Jun 9 07:18:51 EDT 2000


If you want to run it in the IDLE IDE, type the following at the interpreter
prompt:

import <saved file name>

where <saved file name> is, er, the name of the file you saved, *without*
the .py extension. Note that if you edit the file and save it again, to run
it again from the interpreter prompt, you have to reload it:

reload(<saved file name>)

Or as Shae Erisson has already suggested (which I personally find easier):

python <saved file name>.py

at a command prompt.

Robin Porter <mogul at primus.ca> wrote in message
news:q_z%4.828$223.8755 at news1.tor.primus.ca...
|     How is it that you run code once you enter it?  I am using Python
1.5.2
| in Win 9x.  After inputing the code in the Python GUI, and saving it, I
have
| been trying to run it by pressing F5 or pressing edit (top menu) and then
| selecting RUN at the bottom.  Please tell me what I am doing wrong?
|     Thank you so much for your help.
|
| Robin
|
| Here is the code:
|
| TaxRate  = 0.23
| MinPay   = 300.0
| RegHours = 40.0
|
| TaxPayable = 0
| Overtime = 0
| OvertimeHours = 0.0
|
| HoursWorked = float(raw_input("Please enter the hours worked per week? "))
| PayRate = float(raw_input("Please enter the rate of pay? "))
|
| if HoursWorked > RegHours:
|     OvertimeHours = HoursWorked - RegHours
|     Overtime = (OvertimeHours) * (PayRate*1.5)
|
| GrossPay = ((HoursWorked-OvertimeHours)*PayRate)+Overtime
|
| if GrossPay > MinPay:
|   TaxPayable = (GrossPay-MinPay)*TaxRate
|
| NetPay = (GrossPay-TaxPayable);
|
| print "The gross pay is %f" % GrossPay
| print "The net pay is %f" % NetPay
|
|
|
|





More information about the Python-list mailing list