[Tutor] Python 3.7 Grids

2019-06-29 Thread David Merrick
Hi Looking for a way to use the determine the position of a card in a grid using the mouse click event in Python. Code is attached. There are no viruses. Unfortunately using Tinkter grids / frames can't determine between the two demo cards. Any suggestions are welcome -- Dave Merrick TutorInve

[Tutor] Python 3.7 Grids

2019-06-28 Thread David Merrick
Hi Looking for a way to use the determine the position of a card in a grid using the mouse click event in Python. Code is attached. Unfortunately using Tinkter grids / frames can't determine between the two demo cards. The Relevant code is below def showCardInitial(cardList): cardsToPlay = [

[Tutor] List problem

2011-07-24 Thread David Merrick
class Node: def __init__(self,initdata): self.data = initdata self.next = None def getData(self): return self.data def getNext(self): return self.next def setdata(self,newData): self.data = newData def setNext(self,newnext): sel

[Tutor] Stack problem usind Python2.6

2011-07-21 Thread David Merrick
##from stack import Stack class Stack: def __init__(self): self.items =[] def isEmpty(self): return self.items ==[] def push(self,item): self.items.append(item) def pop(self,item): self.items.pop() def peek(self): return self.items[l

[Tutor] Installing module and running

2011-07-19 Thread David Merrick
I want to install the first module http://code.google.com/p/python-nose/downloads/list -- Dave Merrick merrick...@gmail.com Ph 03 3423 121 Cell 027 3089 169 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

[Tutor] Blackjackbetting

2011-07-03 Thread David Merrick
HI. I feel I'm starting to go round in circles solving this problem. I feel I made significant progress. Can someone help me iron out the bugs please # Blackjack # From 1 to 7 players compete against a dealer import cards, games class BJ_Card(cards.Card): """ A Blackjack Card. """ ACE_VA

[Tutor] Blackjack Betting

2011-07-02 Thread David Merrick
Each player needs to be able to bet # Blackjack # From 1 to 7 players compete against a dealer import cards, games class BJ_Card(cards.Card): """ A Blackjack Card. """ ACE_VALUE = 1 @property def value(self): if self.is_face_up: v = BJ_Card.RANKS.index(self.r

[Tutor] (no subject)

2011-07-01 Thread David Merrick
# Blackjack # From 1 to 7 players compete against a dealer import cards, games class BJ_Card(cards.Card): """ A Blackjack Card. """ ACE_VALUE = 1 @property def value(self): if self.is_face_up: v = BJ_Card.RANKS.index(self.rank) + 1 if v > 10:

[Tutor] Python GUI

2011-06-28 Thread David Merrick
# Guess My Number GUI # Create a story based on user input from tkinter import * import random class Application(Frame): """ GUI application that creates a story based on user input. """ def __init__(self, master): """ Initialize Frame. """ super(Application, self).__init__

Re: [Tutor] Tutor Digest, Vol 88, Issue 103

2011-06-27 Thread David Merrick
Thanks that should help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class methods

2011-06-26 Thread David Merrick
Is it possible too have crit1 = Critter("Dave") crit2 = Critter("Sweetie") farm = [crit1,crit2] #List# and then be able to use Critters methods on farm? # Critter Caretaker # A virtual pet to care for class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, bore

[Tutor] Class methods

2011-06-22 Thread David Merrick
Can someone show me how to code this correctly please? # Critter Caretaker # A virtual pet to care for class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0): self.name = name self.hunger = hunger self.boredom = boredom #

Re: [Tutor] Tutor Digest, Vol 88, Issue 89

2011-06-22 Thread David Merrick
> > Can someone show me how to code this correctly please > > > class Critter(object): > > > >def __init__(self, name, hunger = 0, boredom = 0): > >def __pass_time(self): > >def __str__(self): > >@property > >def mood(self): > >def talk(self): > >def eat(self): > >de

Re: [Tutor] Tutor Digest, Vol 88, Issue 89

2011-06-22 Thread David Merrick
011 08:58:03 +0100 > From: "Alan Gauld" > To: tutor@python.org > Subject: Re: [Tutor] Class methods > Message-ID: > Content-Type: text/plain; format=flowed; charset="UTF-8"; >reply-type=original > > "David Merrick" wrote > >

[Tutor] Class methods

2011-06-21 Thread David Merrick
# Critter Caretaker # A virtual pet to care for class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0): self.name = name self.hunger = hunger self.boredom = boredom # __ denotes private method def __pass_time(self):

Re: [Tutor] Tutor Digest, Vol 88, Issue 86

2011-06-21 Thread David Merrick
I have created a Critter object and a Farm object which is two critters. I want to use Critters methods in the Farm object as it just 2 critters in a list crit1 = Critter("Sweetie") crit2 = Critter("Dave") farmlet = [crit1,crit2] # Critter Caretaker > # A virtual pet to care for > class Critter(

[Tutor] Using Class methods

2011-06-21 Thread David Merrick
I need help using Class methods in another class. I have a class called Critter and I want to create two critters in a farm Class Farm and use Class Critter's methods -- Dave Merrick merrick...@gmail.com Ph 03 3423 121 Cell 027 3089 169 critter_farm2.py Description: Binary data ___

[Tutor] Using class methods

2011-06-21 Thread David Merrick
I need help using Class methods in another class. I have a class called Critter and I want to create two critters in a farm Class Farm and use Class Critter's methods # A virtual pet to care for class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0):

[Tutor] Problem

2011-06-17 Thread David Merrick
# Critter Caretaker # A virtual pet to care for class Farm(object): #A collection of Critters def talk(self,farm): farm.talk() class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0): self.name = name self.hunger = hunger

Re: [Tutor] Tutor Digest, Vol 87, Issue 114

2011-05-28 Thread David Merrick
As a new user of Pytrhon and previous user of Java,C(+),Php. There is very little difference. In some cases Python might be slower but I don't think it would mnake that much difference. The major differnce is the syntax of how you write and layout your code. Chreers Dave On Sat, May 28, 2011 at 1

[Tutor] PI

2011-05-25 Thread David Merrick
How do I can access to the math module to use PI? area = math.pi * pow(3,2) Traceback (most recent call last): File "", line 1, in area = math.i * pow(3,2) NameError: name 'math' is not defined -- Dave Merrick merrick...@gmail.com Ph 03 3423 121 Cell 027 3089 169 _