[Tutor] Tutor Digest, Vol 80, Issue 11

Edward Lang edwardlang at optonline.net
Sat Oct 2 17:44:37 CEST 2010



tutor-request at python.org wrote:

>Send Tutor mailing list submissions to
>	tutor at 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
>	tutor-request at python.org
>
>You can reach the person managing the list at
>	tutor-owner at python.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Tutor digest..."
>
>
>Today's Topics:
>
>   1. Re: Connecting my users (Timo)
>   2. Re: data question (Alan Gauld)
>   3. Re: data question (Roelof Wobben)
>   4. Re: data question (Roelof Wobben)
>   5. Re: data question (Roelof Wobben)
>   6. Re: data question (Robert Berman)
>   7. Re: Coin Toss Problems (bob gailer)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Sat, 02 Oct 2010 12:06:14 +0200
>From: Timo <timomlists at gmail.com>
>To: Nitin Pawar <nitinpawar432 at gmail.com>
>Cc: tutor at python.org
>Subject: Re: [Tutor] Connecting my users
>Message-ID: <4CA70416.2050205 at gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>On 01-10-10 11:25, Nitin Pawar wrote:
>> have a look at this
>>
>> http://bytes.com/topic/python/answers/826973-peer-peer-chat-program
>
>Thanks, but that still uses a server. And even one that I can't control! 
>If it has to be with server interaction, than as little as possible is 
>preferred and option to put it on my own.
>
>Cheers,
>Timo
>
>>
>> On Fri, Oct 1, 2010 at 2:49 PM, Timo <timomlists at gmail.com 
>> <mailto:timomlists at gmail.com>> wrote:
>>
>>     Hello,
>>
>>     I have the following idea, but no clue how to implement this.
>>     I want my users to be able to connect to other users (with the
>>     same program) and chat with them and exchange files. Ideally
>>     without server interaction. Now I heard about peer-to-peer and
>>     bittorrent protocol etc. But don't know where to start or that I'm
>>     even at the right path.
>>     So if anyone can point me into the right direction of a framework
>>     or protocol I should use for this, it would be appreciated.
>>
>>     Cheers,
>>     Timo
>>
>>     _______________________________________________
>>     Tutor maillist  - Tutor at python.org <mailto:Tutor at python.org>
>>     To unsubscribe or change subscription options:
>>     http://mail.python.org/mailman/listinfo/tutor
>>
>>
>>
>>
>> -- 
>> Nitin Pawar
>>
>
>
>
>------------------------------
>
>Message: 2
>Date: Sat, 2 Oct 2010 14:10:25 +0100
>From: "Alan Gauld" <alan.gauld at btinternet.com>
>To: tutor at python.org
>Subject: Re: [Tutor] data question
>Message-ID: <i87b0a$s0v$1 at dough.gmane.org>
>Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>	reply-type=original
>
>
>"Roelof Wobben" <rwobben at hotmail.com> wrote
>
>> As a test I would write a programm where a user can input game-data
>> like home-team, away-team, home-score, away-score) and makes a
>> ranking of it.
>
>> In which datatype can I put this data in.
>>
>> I thought myself of a dictonary of tuples.
>
>A dictionary would be good for the basic data but I assume there
>are more than one of these data items? If so what do they represent?
>How would they be used?
>
>We need a bit more information, even some sample datya might help.
>
>It could be a list of dictionaries or even a dictionary of 
>dictionaries.
>
>Alan G.
>
>
>
>
>------------------------------
>
>Message: 3
>Date: Sat, 2 Oct 2010 13:10:03 +0000
>From: Roelof Wobben <rwobben at hotmail.com>
>To: <tutor at python.org>
>Subject: Re: [Tutor] data question
>Message-ID: <SNT118-W630E6E394CA68B65D3010BAE6A0 at phx.gbl>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>
>
>----------------------------------------
>> From: rwobben at hotmail.com
>> To: bermanrl at cfl.rr.com
>> Subject: RE: [Tutor] data question
>> Date: Sat, 2 Oct 2010 13:09:23 +0000
>>
>>
>>
>>
>> ----------------------------------------
>>> From: bermanrl at cfl.rr.com
>>> To: rwobben at hotmail.com; tutor at python.org
>>> Subject: RE: [Tutor] data question
>>> Date: Sat, 2 Oct 2010 09:02:41 -0400
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: tutor-bounces+bermanrl=cfl.rr.com at python.org [mailto:tutor-
>>>> bounces+bermanrl=cfl.rr.com at python.org] On Behalf Of Roelof Wobben
>>>> Sent: Saturday, October 02, 2010 4:35 AM
>>>> To: tutor at python.org
>>>> Subject: [Tutor] data question
>>>>
>>>>
>>>>
>>>> Hello,
>>>
>>>> Now my question is :
>>>>
>>>> In which datatype can I put this data in.
>>>>
>>> Perhaps a simple SQLlite database?
>>> http://zetcode.com/databases/sqlitetutorial/
>>>
>>> Hope this helps,
>>>
>>> Robert
>>>
>>>
>>>
>>>> Regards,
>>>>
>>>> Roelof
>>>>
>>>> _______________________________________________
>>>> Tutor maillist - Tutor at python.org
>>>> To unsubscribe or change subscription options:
>>>> http://mail.python.org/mailman/listinfo/tutor
>>>
>
>Oke,
>
>Oke, there I can save the input data.
>But I have also need a data model for team, played_games, game_points, made_points and againts_points.
>So I think it cannot be done without using a class for games and one for ranking.
>And figuring out how I can store the game-data in a text or database file.
>
>Roelof 		 	   		  
>
>------------------------------
>
>Message: 4
>Date: Sat, 2 Oct 2010 13:15:33 +0000
>From: Roelof Wobben <rwobben at hotmail.com>
>To: <alan.gauld at btinternet.com>, <tutor at python.org>
>Subject: Re: [Tutor] data question
>Message-ID: <SNT118-W195CF690C7E6969F5FC4EEAE6A0 at phx.gbl>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>
>
>----------------------------------------
>> To: tutor at python.org
>> From: alan.gauld at btinternet.com
>> Date: Sat, 2 Oct 2010 14:10:25 +0100
>> Subject: Re: [Tutor] data question
>>
>>
>> "Roelof Wobben" wrote
>>
>>> As a test I would write a programm where a user can input game-data
>>> like home-team, away-team, home-score, away-score) and makes a
>>> ranking of it.
>>
>>> In which datatype can I put this data in.
>>>
>>> I thought myself of a dictonary of tuples.
>>
>> A dictionary would be good for the basic data but I assume there
>> are more than one of these data items? If so what do they represent?
>> How would they be used?
>>
>> We need a bit more information, even some sample datya might help.
>>
>> It could be a list of dictionaries or even a dictionary of
>> dictionaries.
>>
>> Alan G.
>>
>>
>> _______________________________________________
>> Tutor maillist - Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>
>Hello Alan, 
>
>What I meant was this:
> 
>Let's say we have a tournament of 4 teams A,B,C,D
> 
>They played this games.
> 
>A - B  20 - 30 
>C - D  23 - 67 
> 
>These data must be stored so I can make a module which make a ranking like this :
> 
>1) C   1 - 2  76 - 23 
>2) B   1 - 2   30 - 20
> 
>I hope you know what I wan
> 
> 
>Roelof
>  		 	   		  
>
>------------------------------
>
>Message: 5
>Date: Sat, 2 Oct 2010 13:40:21 +0000
>From: Roelof Wobben <rwobben at hotmail.com>
>To: <alan.gauld at btinternet.com>, <tutor at python.org>
>Subject: Re: [Tutor] data question
>Message-ID: <SNT118-W27A004D0EADDFA4F499ACAE6A0 at phx.gbl>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>hello, 
> 
>Still one question.
> 
>Every game is a dictonary/tuple ?
> 
>Regards,
> 
>Roelof
>
>----------------------------------------
>> Date: Sat, 2 Oct 2010 06:24:16 -0700
>> From: alan.gauld at btinternet.com
>> Subject: Re: [Tutor] data question
>> To: rwobben at hotmail.com
>>
>> OK, So you want a list of games (possibly one per tournament
>> if you need to compare across tournies) where for each game
>> you store: homeTeam, awayTeam and scores.
>>
>> Each game could be represented as either a tuple or a dictionary
>> depending on how you want to extract the data:
>>
>> game['home'] or game[0]
>>
>> The list should probably be a list... :-)
>>
>> Try defining a short sample database in Python then try
>> extracting some values to get a feel for what suits you
>> best. Create the data in a module(easier to edit mistakes/changes)
>> Then use the>>> prompt to import the data module and play
>> around with it.
>>
>> That way it's easy to change from lists to tuples to dictionaries
>> and see what works.
>>
>> Ultimately this may even be best done using a database but
>> that's probably a step too far for you just now.
>>
>> Alan Gauld
>> Author of the Learn To Program website
>> http://www.alan-g.me.uk/
>>
>>
>>
>>
>> ----- Original Message ----
>>> From: Roelof Wobben 
>>> To: alan.gauld at btinternet.com; tutor at python.org
>>> Sent: Saturday, 2 October, 2010 14:15:33
>>> Subject: RE: [Tutor] data question
>>>
>>>
>>>
>>>
>>> ----------------------------------------
>>>> To: tutor at python.org
>>>> From: alan.gauld at btinternet.com
>>>> Date: Sat, 2 Oct 2010 14:10:25 +0100
>>>> Subject: Re: [Tutor] data question
>>>>
>>>>
>>>> "Roelof Wobben" wrote
>>>>
>>>>> As a test I would write a programm where a user can input game-data
>>>>> like home-team, away-team, home-score, away-score) and makes a
>>>>> ranking of it.
>>>>
>>>>> In which datatype can I put this data in.
>>>>>
>>>>> I thought myself of a dictonary of tuples.
>>>>
>>>> A dictionary would be good for the basic data but I assume there
>>>> are more than one of these data items? If so what do they represent?
>>>> How would they be used?
>>>>
>>>> We need a bit more information, even some sample datya might help.
>>>>
>>>> It could be a list of dictionaries or even a dictionary of
>>>> dictionaries.
>>>>
>>>> Alan G.
>>>>
>>>>
>>>> _______________________________________________
>>>> Tutor maillist - Tutor at python.org
>>>> To unsubscribe or change subscription options:
>>>> http://mail.python.org/mailman/listinfo/tutor
>>>
>>> Hello Alan,
>>>
>>> What I meant was this:
>>>
>>> Let's say we have a tournament of 4 teams A,B,C,D
>>>
>>> They played this games.
>>>
>>> A - B 20 - 30
>>> C - D 23 - 67
>>>
>>> These data must be stored so I can make a module which make a ranking like
>>>this :
>>>
>>> 1) C 1 - 2 76 - 23
>>> 2) B 1 - 2 30 - 20
>>>
>>> I hope you know what I wan
>>>
>>>
>>> Roelof
>>> 		 	   		  
>
>------------------------------
>
>Message: 6
>Date: Sat, 2 Oct 2010 09:02:41 -0400
>From: "Robert Berman" <bermanrl at cfl.rr.com>
>To: "'Roelof Wobben'" <rwobben at hotmail.com>,	<tutor at python.org>
>Subject: Re: [Tutor] data question
>Message-ID: <007801cb6232$18d1a370$4a74ea50$@rr.com>
>Content-Type: text/plain;	charset="us-ascii"
>
>
>
>> -----Original Message-----
>> From: tutor-bounces+bermanrl=cfl.rr.com at python.org [mailto:tutor-
>> bounces+bermanrl=cfl.rr.com at python.org] On Behalf Of Roelof Wobben
>> Sent: Saturday, October 02, 2010 4:35 AM
>> To: tutor at python.org
>> Subject: [Tutor] data question
>> 
>> 
>> 
>> Hello,
> 
>> Now my question is :
>> 
>> In which datatype can I put this data in.
>> 
>Perhaps a simple SQLlite database? 
>http://zetcode.com/databases/sqlitetutorial/
>
>Hope this helps,
>
>Robert
>
>
> 
>> Regards,
>> 
>> Roelof
>> 
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor
>
>
>
>------------------------------
>
>Message: 7
>Date: Sat, 02 Oct 2010 11:02:36 -0400
>From: bob gailer <bgailer at gmail.com>
>To: tutor at python.org
>Subject: Re: [Tutor] Coin Toss Problems
>Message-ID: <4CA7498C.5070002 at gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>  On 10/1/2010 6:52 AM, delegbede at dudupay.com wrote:
>> This is also a learner's advice, so just give it a shot.
>> In the first function, set HEADS to 0 and TAILS to 0.
>> Then if flip==0, heads=heads+1
>> Return Heads.
>> Do same for Tails and see if it makes any sense.
>> Regards.
>
>Isn't Python case sensitive?
>
>
>-- 
>Bob Gailer
>919-636-4239
>Chapel Hill NC
>
>
>
>------------------------------
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
>End of Tutor Digest, Vol 80, Issue 11
>*************************************


More information about the Tutor mailing list