Re: [Tutor] (no subject)

2007-06-29 Thread Michael Sullivan
On Fri, 2007-06-29 at 09:54 -0400, Jason Bertrand wrote:
 Please remove me from the mailing list.
 
 Thank you
 
 Jason P Bertrand
 JPB Enterprises
 www.businessloansandleasing.com
 (860) 982-5334

No one can do that except you.   Look at the list headers to see how.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python related mags

2006-06-13 Thread Michael Sullivan
On Tue, 2006-06-13 at 16:49 +, ingo wrote:
 in news:[EMAIL PROTECTED] Evans Anyokwu wrote:
 
  But then again, who is going to initiate the first move?? 
  
 
 Here's a name: Monthly Python

Yes.  They had a large influence in the birth of the language, but I'm
not so sure if they still do...

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] assignment statements in python

2006-06-12 Thread Michael Sullivan
On Sun, 2006-06-11 at 22:14 -0400, Kermit Rose wrote:
   Message: 1
 Date: Sun, 11 Jun 2006 06:58:39 -0400
 From: Kent Johnson [EMAIL PROTECTED]
 Subject: Re: [Tutor] buggy bug in my program
 Cc: tutor@python.org
  
 Assignment in Python is not a copy, it is a name binding. Assignment
 creates a name for an object. If you assign the same object to two
 names, they both are bound to the same thing. If the object is mutable,
 like a list, changes to the object will be seen regardless of which name
 you use to refer to it.
  
 **

In that case, is it possible to copy a variable by value, instead of by
reference, in Python?

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python related mags

2006-06-12 Thread Michael Sullivan
On Mon, 2006-06-12 at 21:13 -0400, Andrew Robert wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Now that is a real pity.
 
 Wish I were talented enough to do it myself.

Someone could do something like Tux Magazine
(http://www.tuxmagazine.org/) .  Each month they put out a free Linux
magazine in the form of a downloadable pdf file.  It's supposed to be
geared toward new Linux users.  I particularly like the pdf format,
because it doesn't take up space in my apartment, just on my hard
drive...

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] connect to a remote machine - Linux

2006-06-11 Thread Michael Sullivan
On Sun, 2006-06-11 at 15:19 +, Patricia wrote:
 Hi All,
 
 I need to connect to a remote computer on the same network to store data into 
 its mysql database, and I need to do this using python script.
 
 Although I've used mysql and python before, I have no idea how to access a 
 remote computer with Python. Also, I would have to enter a passphrase and 
 password to successfully connect to it.. 
 
 I'd appreciate any help.
 Thanks!!
 
 Patricia




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] An Introduction and a question

2006-06-10 Thread Michael Sullivan
On Sat, 2006-06-10 at 03:27 +0100, Jonathon Sisson wrote:
 Michael Sullivan wrote:
  Here's the situation:  My wife likes to play the game Chuzzle, found at
  Yahoo Games.  We use primarily Linux, however Chuzzle is written as an
  ActiveX control, which only works on Windows.  I have not been able to
  get Internet Explorer to work correctly through Wine, 
 
 This might not be a Python topic, but I figured I'd respond with what I
 know on this particular subject...
 
 ActiveX can be run in Linux using the WINDOWS version of Mozilla in Wine
 and a little bit of coaxing as per this HOWTO on the Gentoo Forums (make
 sure you install the ActiveX control in Wine...):
 
 http://forums.gentoo.org/viewtopic-t-246098-highlight-warcraft.html
 
 World of Warcraft uses ActiveX in it's patch updater, and although I've
 never personally run it I've had many people tell me this method works.
  Now if I could just figure out how to convince my wife to try Linux (as
 you apparently have done) then I'd be set...kudos to you on that.
 
 Jonathon

My wife says that she actually prefers Linux over Windows.  The only
thing we use Windows for is playing Civilizations II and The Sims,
although she also uses it for playing Internet games that don't work on
Linux.  She's said that if I can make Linux versions of those games she
plays on Windows, she won't use Windows at home anymore.  When I first
started with Linux, she was kinda iffy about it, but now she loves it.
We've only used it since fall of 2003...

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] An Introduction and a question

2006-06-09 Thread Michael Sullivan
My name is Michael Sullivan.  I am a 26 year-old college student in
Oklahoma. My wife and I have a small (three PCs) computer network that
we operate out of our home.  We have our own domain (as one could tell
by examining my email address)  I have novice-level experience with VB,
C/C++, Java, and PHP, but I'm just starting out with Python.  

Here's the situation:  My wife likes to play the game Chuzzle, found at
Yahoo Games.  We use primarily Linux, however Chuzzle is written as an
ActiveX control, which only works on Windows.  I have not been able to
get Internet Explorer to work correctly through Wine, so I determined to
write a Chuzzle-like game (with many of my own enhancements) for Linux.
I've been playing around with some Pygame examples lately, and thought
that I'd try writing the game in Python (I've been meaning to learn
Python for years, but just never got around to it.)  Today I started on
writing the game.  I've decided (at least for now) to call my version,
LinePuzzle.  For those of you unfamiliar with Chuzzle, here's the basic
concept:  There are individual pieces of different colors arranged on a
grid.  The pieces can be moved on a line either vertically or
horizontally.  The object of the game is to position three similarly
colored pieces ajacent to each other.  At this point the three pieces
will disappear, and the pieces above them will fall to take their place.
As the levels progress, locks are added so that the player cannot move a
locked piece either horizontally or vertically.  The game is over when
no more pieces can be removed.  

I started my script by creating a class called LinePuzzlePiece which
represents a single coloured piece.  I wanted a random colour chosen
from a list to be assigned to the piece, and then to prove that I had it
set up correctly, I wanted to call a method that would print out the
color of the piece.  Here is my code:

#!/usr/bin/env python

import random
import time
import math

class LinePuzzlePiece:
   This class defines a single playing piece for LinePuzzle
   def __init__(self):
  seed(time)
  index = int(math.floor(uniform(1, 10)))   colorlist = [red,
blue, green yellow, purple]   self.color = colorlist[index]

   def printcolor():
  print self.color

mypiece = LinePuzzlePiece
mypiece.printcolor


I saved the script and made it chmod +x.  However, when I run it, I get
this:

[EMAIL PROTECTED] ~ $ ./linepuzzle.py
[EMAIL PROTECTED] ~ $

Now, I'm no expert, but I really think something should have been
printed, if even a blank line.  What am I doing wrong here?  Why is
nothing printing?  Is my printcolor method even being called
successfully?
-Michael Sullivan-



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] An Introduction and a question (continuing)

2006-06-09 Thread Michael Sullivan
OK.  I've got it working this far.  Now I want the script to generate
eight pieces, each with a random colour.  Here's my current code:

#!/usr/bin/env python

import random
import time
import math

class LinePuzzlePiece:
   This class defines a single playing piece for LinePuzzle
   def __init__(self):
  random.seed(time)
  index = int(math.floor(random.uniform(0, 8)))
  colorlist = [red, blue, green, yellow, purple, cyan,
orange, white]
  self.color = colorlist[index]

   def printcolor(self):
  print self.color

piececount = 0
mypiece = [, , , , , , , , ]
while (piececount  9):
   mypiece[piececount] = LinePuzzlePiece()
   mypiece[piececount].printcolor()
   piececount += 1

The problem is that while eight pieces are created and assigned a
colour, the colour is always the same.  I need the colours of the pieces
to be in a somewhat random order.  What am I doing wrong?

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor