[Tutor] what happened to the cards module

2010-09-15 Thread jsoares
I downloaded Python 2.6.6 for windows but I can't access the "Cards" module for 
playing card games.

Did it get renamed? If so, how can I find it?

Thanks.

John Soares
jsoa...@safe-mail.net
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Re: IDLE crashing suddenly

2005-04-08 Thread jsoares
I've noticed that after 20 or 30 compile/link/execute runs, IDLE crashes. This seems to happen pretty consistently. At the time, I'm not doing anything that might cause it to crash.

Does this happen to anyone else? What causes it? Is it just a bug? I have IDLE version 1.1.1 which came with Python 2.4.

Thanks.

John Soares
[EMAIL PROTECTED]


 Original Message 
From: [EMAIL PROTECTED]
Apparently from: [EMAIL PROTECTED]
To: tutor@python.org
Subject: Tutor Digest, Vol 14, Issue 25
Date: Fri,  8 Apr 2005 19:37:37 +0200 (CEST)

Send Tutor mailing list submissions to
	tutor@python.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
	[EMAIL PROTECTED]

You can reach the person managing the list at
	[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."


Today's Topics:

   1. Re: Support (Alberto Troiano)
   2. Recursive list checking (joe_schmoe)
   3. Re: Support (Kent Johnson)
   4. Re: comparison function/built-in needed (joe_schmoe)
   5. Re: Recursive list checking (Jeffrey Maitland)
   6. Re: Recursive list checking (Jeffrey Maitland)
   7. Re: str.split and quotes (Marilyn Davis)
   8. Re: Re: Recursive list checking (Kent Johnson)
   9. Re: Associate functinos with Dictionary/Class Usage (Luke Jordan)


--

Message: 1
Date: Fri, 08 Apr 2005 15:31:42 +
From: "Alberto Troiano" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Support
To: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050408/42201ce3/attachment-0001.html

--

Message: 2
Date: Fri, 08 Apr 2005 16:55:26 +0100
From: joe_schmoe <[EMAIL PROTECTED]>
Subject: [Tutor] Recursive list checking
To: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Dear Pythonites

I am looking for a more elegant solution to a piece of code that is too 
unwieldy and reptitive. The purpose of the code is for a new addition to 
a list to check whether it is a duplicate of a list element already a 
member of that list, and if so to regenerate itself randomly and to 
perform the same check again until such time as it is unique.
For example, this is what I am currently doing:

=code block 

# generate unique numbers and append to list
nmbr01 = random.randrange( 1, 20 )
nmbr_list.append( nmbr01 )

nmbr02 = random.randrange( 1, 20 )
# check for duplicates and re-generate a number if needed
while nmbr02 in nmbr_list:
nmbr02 = random.randrange( 1, 20 )
nmbr_list.append( nmbr02 )

nmbr03 = random.randrange( 1, 20 )
while nmbr03 in nmbr_list:
nmbr03 = random.randrange( 1, 20 )
nmbr.append( nmbr03 )



This method works, but increasing the numbers to be appended makes the 
code excessively long. I can't see anything in list methods that seems 
to do the trick, so anybody want to make a suggestion please?

TIA
/j


--

Message: 3
Date: Fri, 08 Apr 2005 11:59:24 -0400
From: Kent Johnson <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Support
Cc: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Alberto Troiano wrote:
> I tried the code below but the image gets messed up:
> 
> import Image
> 
> im=Image.open("auto.jpg")
> 
> im.show() ###This is to show the image so you can see it
> 
> m=im.tostring()
> 
> ima=Image.fromstring("RGB",im.size,m)###I tried also with F,RGBA 
> and L mode instead of RGB

maybe ima=Image.fromstring(im.mode,im.size,m) will work...

Kent



--

Message: 4
Date: Fri, 08 Apr 2005 17:10:29 +0100
From: joe_schmoe <[EMAIL PROTECTED]>
Subject: Re: [Tutor] comparison function/built-in needed
To: Kent Johnson <[EMAIL PROTECTED]>
Cc: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Kent Johnson wrote:
> joe_schmoe wrote:
> 
>> Greetings
>>
>> I am attempting to compare the items in two lists across two criteria 
>> - membership and position. For example:
>>
>> list_a = [ 0, 4, 3, 6, 8 ]
>> list_b = [ 1, 8, 4, 6, 2 ]
>>
>> Membership = There are 3 items that are common to both lists, that is 
>> 3 items in list_a have membership in list_b (viz: 4, 6, 8);
> 
> 
> Use sets:
>  >>> list_a = [ 0, 4, 3, 6, 8 ]
>  >>> list_b = [ 1, 8, 4, 6, 2 ]
>  >>> set(list_a).intersection(list_b)
> set([8, 4, 6])
> 
>> Position = There is 1 item in list_a that is also in the same position 
>> in both lists (viz: 6).
> 
> 
> Use zip() to iterate two lists in parallel and a list comprehension 

[Tutor] Re: Notepad++ support for Python

2005-04-08 Thread jsoares
I need a backup editor for IDLE, so I'm trying Notepad++. It looks nice, but there is no direct support for running Python.What you have to do is click the "Run" menu item and then you type the command line for the Python interpreter. This should be simple; there are only to .exe files: python and pythonw.The python.exe file brings up the shell, while the pythonw.exe brings up a black screen that very quickly goes away.What do I do?I would think: python(w).exe %filename%or something like that. Is there a .bat file somewhere that starts everything off?Thanks.=John Soares, WebmasterFamily Safe Surfinghttp://www.family-safe-surfing.net[EMAIL PROTECTED][EMAIL PROTECTED]"Your best bet for online family-friendly resources"=___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Re: Interesting anomaly with the Eight Queens problem

2005-04-13 Thread jsoares
I read through Magnus Hetland's book and noticed the Eight Queens problem, which I had solved some time ago using Visual Basic.This time, I wanted to use a non-recursive solution. I randomly place each queen on board coordinates running from 0,0(top left hand corner of board) to 7,7(lower right hand corner of board)Here's the interesting part: I can only get eight queens safely on the board perhaps every one in 20 runs. At least 12 or 13 of those times, I can place seven queens, while five or six times, I can only place six queens or even five!Once a queen is safely placed, I establish her "territory". Once this is done, when I try to place a subsequent queen, I check for all placed queen's territories. Once I place six or seven queens, I have to give the program a lot more tries to try to find a safe square. And it can't always be done.Does this sound right? Does trying to place each queen randomly cause this anomaly?I can post my code(beginner code!) if anyone is interested in seeing it.Best,John=John Soares, WebmasterFamily Safe Surfinghttp://www.family-safe-surfing.net[EMAIL PROTECTED][EMAIL PROTECTED]Tel: (810) 343-0571Fa
x: (866) 895-3082"Your best bet for online family-friendly resources"=___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Re: Recursion....what are the best situations to use it?

2005-04-14 Thread jsoares
I've seen a couple of nice tutorials on recursion, and a lot of awful ones. The latter always trot out the fibonacci and factorial examples for some reason. And that's about it! The good ones showed me how to trace through recursive calls and gave me practical examples(tictactoe, magic squares, Tower of Hanoi, 4-Square, etc)What I want to know is this: what are other specific situations where a recursive algorithm would be better or easier to program than an iterative one?I know that the Eight Queens puzzle is a good recursion candidate, but I don't understand why as yet. I'm still on simple recursion, and am just beginning to understand backtracking in a simple example, like adding numbers in an array.From what I've read, it seems like two dimensional games or puzzles would be good candidates for recursive programming. Also, things like random maz!
 e generation...I saw something on Pierzonski's(sic) Carpet, but I didn't really understand it. I did understand that anything to do with manipulating patterns might be a good recursion candidate.If this is too general a question, perhaps you can tell me when NOT to use recursion(where it would be inappropriate or inefficient).I'd certainly like to learn what seems like a powerful tool, but I don't want to use it where I shouldn't.Any hints appreciated.John=John Soares, WebmasterFamily Safe Surfinghttp://www.family-safe-surfing.net[EMAIL PROTECTED][EMAIL PROTECTED]"Your best bet for online family-friendly resources"=___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] re: recursion

2005-04-15 Thread jsoares
Thanks for all the replies to my "use of recursion" question. I now have six clear situations where recursion would be best. The consensus seems to be that if you have anything that might contain something underneath it(like a main menu with submenus), you have a good recursion candidate.Best,John[EMAIL PROTECTED]___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Re: Recommendations needed for a good data structures text

2005-04-15 Thread jsoares
I have never taken a formal course in data structures, and I'm beginning to think I need one. I am mostly self-taught, with most of my formal coursework in computer languages and not computer science.Can anyone recommend a good data structures text that is not too heavy on math and theory? One that I can read on my own without having to take a course? I need something very practical, with many short examples. I'm trying to learn to program 2D games like checkers, card games, etc. I've been to Amazon and have seen many data structures books, but most received mixed reviews. Many emphasize fluency in C++ or Java, both of which I've used, but not for awhile. Quite a few also state that you need a rigorous math background.My ideal data structures book:1. Language-neutral2. Many pseudocode examples3. Light to medium math, math proofs, and theoretical discussions.4. Real world examples and programs, not math related. Games related examples or other practical examples would be very helpful.Thanks for any hints.Best,John[EMAIL PROTECTED]___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 15, Issue 19

2005-05-09 Thread jsoares
I was pleasantly surprised with the Dr. Python editor. Great for Python beginners like me. Also, this editor seems to support the wxWidgets and wxPython bindings library, which I'm trying to learn.

John Soares
[EMAIL PROTECTED]
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor