Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Gay errors that don't even make sense
[b][red]This message was edited by Lazer_Burn at 2005-9-3 9:47:48[/red][/b][hr]
[b][red]This message was edited by Lazer_Burn at 2005-9-2 22:40:56[/red][/b][hr]
I'm gonna skip the background for now cause i;m really frustrated and i can't see straight.
Ok I know the basic of python, and a few other languages. I'm not a total n00b.
Sooo today I decided I'd really crack down and work through my python book. I had done a math problem the other day, it read as follows;
A vending machine will give you a can of coke for 50c, it take quarters, nickels and dimes. I thought i could use this as a basis for a program, you know for purpose purposes.
Ok so i sit down at my comp start up my 2.4 IDE and punch out the following code;
import math # all functions defined here
def newLine(): # creates a new line
def Xline(x): # creates x new lines (mechanics: x changes every time (x-1) is run)
if x > 0:
print "This Program is designed to list he possible combinations for a user defined result"
print "Such as what are the combinations to make 50c out of quarters dimes and nickels"
print "Input up to four values for the devices that will make up the combination"
print "They must be whole number values, if you have less than four devices"
print "Put a 0 for that input"
a = raw_input ("device a")
b = raw_input ("device b")
c = raw_input ("device c")
d = raw_input ("device d")
print "Now input combination total"
z = raw_input ("combination total")
print "Now the program should spit some answers out for you"
pretty simple stuff, just a little refresher. So i decide to save and run and i get these errors;
the first error window pops up saying:
IDLE Subprocess Error
Socker Error: Connection refused
then the second windo pops up and says;
Subprocess startup Error
IDLE's subprocess didn't make a connection, either IDLE can;t start a subprocess or personal firewall software is blocking the connection.
Guess how I'm feelin now....
I look over the code again, looks good to me. It then occurs to me that maybe the commands changed a bit. I learned the basics back in 2.1 and 2.2.
So heres my questions;
What I do wrong?
Anyone know how to get user input into a programmer defined function ( like that Xline(x))?
PS I'm running windows xp pent 4, so gay i'm gettin linux soon....
*The indentations in the code didn't come out for some reason when i cut and pasted*