2.4.2 + Zone Alarm

2006-02-20 Thread DannyB
I believe this issue is known - I haven't found a way around it.

ZoneAlarm seems to be stopping IDLE from running.
I get two errors:

"Socket Error:  Connection refused"
and
"IDLE's subprocess didn'tt make connection.  Either IDLE can't start a
subprocess or personal firewall software is blocking the connection."

I know they are both due to ZA - I've set up ZA to allow Python to
access the internet w/o prompting me (even though I now it doesn't
actually access the internet.)

This usually happens after I create a script and run it in the GUI - if
the script ends up being a never ending loop - I X out of IDLE to stop
it.  The next time I try to run a script I get the errors until I
reboot the computer.

IIs there a fix?  I'm pretty sure that this problem started with 2.3.1
(i'm suing 2.4.2).

Thanks

Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 2.4.2 + Zone Alarm

2006-02-20 Thread DannyB
>Well, good look in court, then...!-)

LOL!  wow thats funny =).  Type-o's can be pretty amusing sometimes.

I will definatly try to reproduce the error w/o running ZA.  I'll post
the bug if it does happen again.

Thanks for the help!!

Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Basic coin flipper program - logical error help

2006-02-21 Thread DannyB
I'm just learning Python.  I've created a simple coin flipper program -
here is the code:

[source]
#Coin flipper
import random

heads = 0
tails = 0
counter = 0

coin = random.randrange(2)

while (counter < 100):
if (coin == 0):
heads += 1
counter += 1
else:
tails += 1
counter += 1

coin = random.randrange(2)


print "\nThe coin landed on heads", heads, "times."
print "\nThe coin landed on tails", tails, "times."
[/source]

<<>>

The program runs - however - it will give me 100 heads OR 100 tails.
Can someone spot the logic error?  

Thanks

~Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Basic coin flipper program - logical error help

2006-02-21 Thread DannyB
Thanks everyone for your insight.

I'm coming from C++ - I'm used to formatting code with {} instead of
whitespaces.

@Larry - this isn't my homework :P  I'm actually taking a VB.NET class
in school.

I was teaching myself C++ but decided to scale back to Python.  I've
heard it was a bit easier to understand and it cuts your development
time by at least 50% (I've heard 90%).

Logically I can figure things out - its the formatting of the logic in
Python that is messing me up.  I'll get it soon enough =)

-- 
http://mail.python.org/mailman/listinfo/python-list


Concantenation and string slicing

2006-02-23 Thread DannyB
I've written a program that takes a phrase and spits it back out
backwards.  My problem is it throws each character on a new line.  I'd
like the phrase to be on the same line.  Is this possible?

#Backward Message

message = raw_input("Enter a message:  ")
letter = len(message)
while (letter > 0):
newMessage = ""
newMessage += message[letter-1]
letter -= 1
print newMessage


Thanks!!

Dan

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Concantenation and string slicing

2006-02-23 Thread DannyB
Wow - thats simple =).  Thanks a ton!!

-- 
http://mail.python.org/mailman/listinfo/python-list


Creating a text adventure

2006-03-02 Thread DannyB
I am in the process of learning Python.  I have the basics down and I
now want to test my abilitiy to use them in a (very) small project.  I
have the idea for a (very) small text based game mapped out in my head.
 It will include two rooms, random creatures (amounts and type) in each
room and random chests in each room.  The basic "battle system" giving
the user the ability to run or attack.  Creatures will have hp, attack,
defense, and name attributes.  The player will have the same.  Treasure
chests will be populated with random treasure.

I'm not adding anything fancy - like I said its just a small project to
gell my newfound knowledge.

What I am looking for is a resource (preferably via the web) that will
give me an idea of how to set things up.  I'm not looking to add any
libraries to the project (so no pygame or livewires).  I'm just using
2.4.2.  I'll add other things when I feel I have 'mastered' the
fundamental concepts of Python.

Thanks for your help!! :)

-- 
http://mail.python.org/mailman/listinfo/python-list