Re: Program Error Help - Python 3.1

2017-03-31 Thread Cameron Simpson
On 31Mar2017 16:12, 2019.cavanau...@fpsedu.org <2019.cavanau...@fpsedu.org> wrote: Hello I've been coding for about 1 or 2 months and i have encountered a problem with a 'while' statement. It keeps looping even when the statement is false, here is the code. The code is for a game that I'm maki

Re: Program Error Help - Python 3.1

2017-03-31 Thread Larry Martell
On Fri, Mar 31, 2017 at 4:16 PM <2019.cavanau...@fpsedu.org> wrote: > while answer8 != ("1") or answer8 != ("2"): This statement is always true. Think about it. > > -- https://mail.python.org/mailman/listinfo/python-list

Re: Program Error Help - Python 3.1

2017-03-31 Thread Terry Reedy
On 3/31/2017 7:12 PM, 2019.cavanau...@fpsedu.org wrote: Hello I've been coding for about 1 or 2 months If at all possible, start with 3.6, not 3.1. and i have encountered a problem with a 'while' statement. You should assume that your code is buggy. That is true even of experts. > It keep

Program Error Help - Python 3.1

2017-03-31 Thread 2019 . cavanaughc
Hello I've been coding for about 1 or 2 months and i have encountered a problem with a 'while' statement. It keeps looping even when the statement is false, here is the code. The code is for a game that I'm making that resembles the Oregon Trial. -Thanks for your help! import random deep =

Re: error help import random

2015-11-20 Thread Dylan Riley
On Friday, November 20, 2015 at 11:06:05 PM UTC, Rob Gaddi wrote: > On Fri, 20 Nov 2015 15:15:42 -0500, Terry Reedy wrote: > > > On 11/20/2015 12:22 PM, Dylan Riley wrote: > >> This is my fortune cookie program i wrote in python. > >> the problem is it will not run past the first line of input. >

Re: error help import random

2015-11-20 Thread Rob Gaddi
On Fri, 20 Nov 2015 15:15:42 -0500, Terry Reedy wrote: > On 11/20/2015 12:22 PM, Dylan Riley wrote: >> This is my fortune cookie program i wrote in python. >> the problem is it will not run past the first line of input. >> could someone please identify the error and explain to me why. >> here is t

Re: error help import random

2015-11-20 Thread Seymore4Head
On Fri, 20 Nov 2015 09:22:10 -0800 (PST), Dylan Riley wrote: >This is my fortune cookie program i wrote in python. >the problem is it will not run past the first line of input. >could someone please identify the error and explain to me why. >here is the code: > >#the program silulates a fortune c

Re: error help import random

2015-11-20 Thread Terry Reedy
On 11/20/2015 12:22 PM, Dylan Riley wrote: This is my fortune cookie program i wrote in python. the problem is it will not run past the first line of input. could someone please identify the error and explain to me why. here is the code: #the program silulates a fortune cookie #the program shoul

Re: error help import random

2015-11-20 Thread Ian Kelly
On Fri, Nov 20, 2015 at 10:57 AM, Peter Otten <__pete...@web.de> wrote: > Dylan Riley wrote: > >> input("\nPress enter to see your fortune") > > Make sure that you run your code with Python 3, not Python 2. Or if you must use Python 2, use raw_input() instead of input(). >> fortune = random.randr

Re: error help import random

2015-11-20 Thread Peter Otten
Dylan Riley wrote: > This is my fortune cookie program i wrote in python. > the problem is it will not run past the first line of input. > could someone please identify the error and explain to me why. > here is the code: > > #the program silulates a fortune cookie > #the program should display o

Re: error help import random

2015-11-20 Thread Chris Angelico
On Sat, Nov 21, 2015 at 4:22 AM, Dylan Riley wrote: > This is my fortune cookie program i wrote in python. > the problem is it will not run past the first line of input. > could someone please identify the error and explain to me why. > here is the code: > > #the program silulates a fortune cookie

error help import random

2015-11-20 Thread Dylan Riley
This is my fortune cookie program i wrote in python. the problem is it will not run past the first line of input. could someone please identify the error and explain to me why. here is the code: #the program silulates a fortune cookie #the program should display one of five unique fortunes, at ran

Re: Error help

2012-08-02 Thread danielashiloh
On Thursday, 2 August 2012 12:18:59 UTC+1, Peter Otten wrote: > danielashi...@googlemail.com wrote: > > > > > This error has been bugging me for days. I know it's minor, but it's > > > really getting in the way of my programming. I'm programming a data > > > analysis programme for a psycholog

Re: Error help

2012-08-02 Thread Philipp Hagemeister
Let's go thorugh this program: On 08/02/2012 12:58 PM, danielashi...@googlemail.com wrote: > import cPickle, pickle you probably want to transparently fall back to pickle if cPickle is not available. > print 'WELLCOME TO THE LIBET CLOCK EXPERIMENT DATA ANALYSIST' > file=raw_input('\nPLEASE ENTER

Re: Error help

2012-08-02 Thread Dave Angel
On 08/02/2012 06:58 AM, danielashi...@googlemail.com wrote: > Hi all > > This error has been bugging me for days. I know it's minor, but it's really > getting in the way of my programming. I'm programming a data analysis > programme for a psychology experiment which takes pickled data from the >

Re: Error help

2012-08-02 Thread marmata
Hi, > This error has been bugging me for days. Doesn't look like a tab error but: > partifipant_info=data'Participant Info'] This line is wrong, it should be: partifipant_info=data['Participant Info'] That's probably what's triggering the error! Cheers, ]\/[arco -- http://mail.python.org/ma

Re: Error help

2012-08-02 Thread Peter Otten
danielashi...@googlemail.com wrote: > This error has been bugging me for days. I know it's minor, but it's > really getting in the way of my programming. I'm programming a data > analysis programme for a psychology experiment which takes pickled data > from the experiment and produces averages. Fo

Error help

2012-08-02 Thread danielashiloh
Hi all This error has been bugging me for days. I know it's minor, but it's really getting in the way of my programming. I'm programming a data analysis programme for a psychology experiment which takes pickled data from the experiment and produces averages. For some reason python is insisting

Operational Error. --HELP

2009-03-30 Thread bijoy franco
Hi, Following is the in-function cursor object. Code:import pgdb __metaclass__=type class addbook: conn=pgdb.connect(dsn='localhost:secondbooks',user='postgres',password='postgres1') curs=conn.cursor() def addBook(self): *infunction_curs=self.curs** *

Operational Error. --HELP

2009-03-30 Thread bijoy franco
Hi, Following is the in-function cursor object. Code:import pgdb __metaclass__=type class addbook: conn=pgdb.connect(dsn='localhost:secondbooks',user='postgres',password='postgres1') curs=conn.cursor() def addBook(self): *infunction_curs=self.curs** *

Re: expat error, help to debug?

2007-08-28 Thread Andreas Lobinger
Aloha, Andreas Lobinger wrote: > Andreas Lobinger wrote: >> Lawrence D'Oliveiro wrote: >>> In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: Anyone any idea where the error is produced? > The registered Handler has to return a (integer) value. > Would have been nice if this had been men

Re: expat error, help to debug?

2007-08-28 Thread Andreas Lobinger
Aloha, Andreas Lobinger wrote: > Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: >>> Anyone any idea where the error is produced? ... to share my findings with you: def ex(self,context,baseid,n1,n2): print "x",context,n1,n2 return 1 T

Re: expat error, help to debug?

2007-08-27 Thread Andreas Lobinger
Aloha, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: >>Anyone any idea where the error is produced? > Do you want to try adding an EndElementHandler as well, just to get more > information on where the error might be happening? I want. Adding an EndElement

Re: expat error, help to debug?

2007-08-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: > Anyone any idea where the error is produced? Do you want to try adding an EndElementHandler as well, just to get more information on where the error might be happening? -- http://mail.python.org/mailman/listinfo/python-list

expat error, help to debug?

2007-08-23 Thread Andreas Lobinger
Aloha, i'm trying to write an xml filter, that extracts some info about an .xml document (with external entities), esp. start elements and external entities. The document is a DOCBOOK xml and afacs well formed and passes our docbook toolchain (dblatex etc.). My parser is (very simple): [115] scyl

PAMIE error help needed

2006-07-19 Thread david brochu jr
I have thrown together a script which reads a list or urls from a txt file and navigates to each url while recording how long it takes for the page to render completely using PAMIE. For some reason I randomly get crashes reporting:     File "c:\Python24\scripts\PAM.py", line 30, in IE_Invoke   

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > sort, then groupby. > > > import itertools > import random > h,t = [len(list(g)) for k,g in itertools.groupby(sorted([random.randrange(2) > for i in xrange(

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Brian van den Broek
DannyB said unto the world upon 21/02/06 06:14 PM: > 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): > i

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Jeffrey Schwab
wes weston wrote: > DannyB wrote: > >> I'm just learning Python. I've created a simple coin flipper program - ... > Dan, >Looping is easier with: > for x in range(100): >if random.randint(0,1) == 0: > heads += 1 >else: > tails += 1 > Or, continuing with that theme:

Re: Basic coin flipper program - logical error help

2006-02-21 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > John Zenger wrote: > > Also, with the functional programming tools of map, filter, and lambda, > > this code can be reduced to just six lines: > > > > import random > > > > flips = map(lambda x: random.randrange(2), xrange(100)) > > he

Re: Basic coin flipper program - logical error help

2006-02-21 Thread bonono
John Zenger wrote: > Also, with the functional programming tools of map, filter, and lambda, > this code can be reduced to just six lines: > > import random > > flips = map(lambda x: random.randrange(2), xrange(100)) > heads = len(filter(lambda x: x is 0, flips)) > tails = len(filter(lambda x: x i

Re: Basic coin flipper program - logical error help

2006-02-21 Thread John Zenger
wes weston wrote: >Looping is easier with: > for x in range(100): >if random.randint(0,1) == 0: > heads += 1 >else: > tails += 1 Also, with the functional programming tools of map, filter, and lambda, this code can be reduced to just six lines: import random flips = map(

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

Re: Basic coin flipper program - logical error help

2006-02-21 Thread Martin P. Hellwig
DannyB wrote: > I'm just learning Python. So am I :-) > 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 ==

Re: Basic coin flipper program - logical error help

2006-02-21 Thread wes weston
DannyB wrote: > 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 >

Re: Basic coin flipper program - logical error help

2006-02-21 Thread Larry Bates
DannyB wrote: > 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 >

Re: Basic coin flipper program - logical error help

2006-02-21 Thread Claudio Grondi
DannyB wrote: > 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 > > while (counter < 100): coin = random.randrange(2) Claudio > if (coin == 0): >

Re: Basic coin flipper program - logical error help

2006-02-21 Thread John McMonagle
On Tue, 2006-02-21 at 16:14 -0800, DannyB wrote: > 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

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 +=