[Tutor] data question

2010-10-02 Thread Roelof Wobben
Hello, 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. And I'm not looking of a OOP solution because im not comfertle with OOP. Now my question is : In which datatype can I put this data in.

Re: [Tutor] Connecting my users

2010-10-02 Thread Timo
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 t

Re: [Tutor] data question

2010-10-02 Thread Alan Gauld
"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

Re: [Tutor] data question

2010-10-02 Thread Roelof Wobben
> From: rwob...@hotmail.com > To: berma...@cfl.rr.com > Subject: RE: [Tutor] data question > Date: Sat, 2 Oct 2010 13:09:23 + > > > > > >> From: berma...@cfl.rr.com >> To: rwob...@hotmail.com; tutor@python.org

Re: [Tutor] data question

2010-10-02 Thread Roelof Wobben
> To: tutor@python.org > From: alan.ga...@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, aw

Re: [Tutor] data question

2010-10-02 Thread Roelof Wobben
hello, Still one question. Every game is a dictonary/tuple ? Regards, Roelof > Date: Sat, 2 Oct 2010 06:24:16 -0700 > From: alan.ga...@btinternet.com > Subject: Re: [Tutor] data question > To: rwob...@hotmail.com > > OK, So you want a list of game

Re: [Tutor] data question

2010-10-02 Thread Robert Berman
> -Original Message- > From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor- > bounces+bermanrl=cfl.rr@python.org] On Behalf Of Roelof Wobben > Sent: Saturday, October 02, 2010 4:35 AM > To: tutor@python.org > Subject: [Tutor] data question > > > > Hello, > Now my que

Re: [Tutor] Coin Toss Problems

2010-10-02 Thread bob gailer
On 10/1/2010 6:52 AM, delegb...@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?

Re: [Tutor] list comprehension, efficiency?

2010-10-02 Thread bob gailer
[snip] I ran dis on a for loop and the equivalent comprehension. I was surprised to see almost identical code. I had assumed (and now wish for) that a comprehension would be a primitive written in C and thus much faster! -- Bob Gailer 919-636-4239 Chapel Hill NC ___

[Tutor] Using contents of a document to change file names

2010-10-02 Thread Josep M. Fontana
Hi, This is my first posting to this list. Perhaps this has a very easy answer but before deciding to post this message I consulted a bunch of Python manuals and on-line reference documents to no avail. I would be very grateful if someone could lend me a hand with this. Here's the problem I want

Re: [Tutor] Tutor Digest, Vol 80, Issue 11

2010-10-02 Thread Edward Lang
tutor-requ...@python.org wrote: >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 > tutor-requ...@

Re: [Tutor] Tutor Digest, Vol 80, Issue 11

2010-10-02 Thread Edward Lang
tutor-requ...@python.org wrote: >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 > tutor-requ...@

Re: [Tutor] Tutor Digest, Vol 80, Issue 11

2010-10-02 Thread Edward Lang
tutor-requ...@python.org wrote: >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 > tutor-requ...@

Re: [Tutor] function error

2010-10-02 Thread roberto
On Thu, Sep 30, 2010 at 1:45 PM, ALAN GAULD wrote: > Copy the code into a text file with a name ending in .py - lets call it > myfile.py for now > (if you have not already done so) > > From a bash prompt type > > $ python myfile.py > > Then cut n paste any error messages into an email to the list

Re: [Tutor] data question

2010-10-02 Thread Roelof Wobben
Hello Alan, I think this is what can work : http://www.daniweb.com/code/snippet216750.html I will try it. Roelof > From: rwob...@hotmail.com > To: alan.ga...@btinternet.com; tutor@python.org > Subject: RE: [Tutor] data question > Date: Sat, 2 Oct

Re: [Tutor] Using contents of a document to change file names

2010-10-02 Thread Greg
On Sat, Oct 2, 2010 at 11:56 AM, Josep M. Fontana wrote: > Then I have another text file containing information about the century each > one of the texts was written. This document has the following structure: > > A-01, 1278 > A-02, 1501 > ... > N-09, 1384 > > To process this, I'd check out the C

Re: [Tutor] function error

2010-10-02 Thread Joel Goldstick
On Sat, Oct 2, 2010 at 12:43 PM, roberto wrote: > On Thu, Sep 30, 2010 at 1:45 PM, ALAN GAULD wrote: >> Copy the code into a text file with a name ending in .py - lets call it >> myfile.py for now >> (if you have not already done so) >> >> From a bash prompt type >> >> $ python myfile.py >> >> Th

Re: [Tutor] Using contents of a document to change file names

2010-10-02 Thread Emile van Sebille
On 10/2/2010 8:56 AM Josep M. Fontana said... Hi, This is my first posting to this list. Perhaps this has a very easy answer but before deciding to post this message I consulted a bunch of Python manuals and on-line reference documents to no avail. I would be very grateful if someone could lend

Re: [Tutor] function error

2010-10-02 Thread Emile van Sebille
On 10/2/2010 10:16 AM Joel Goldstick said... ## import turtle, random def checkForward(distance): old_position = turtle.position() turtle._pen.up() # no show/hide turtle methods in my turtle modul

Re: [Tutor] function error

2010-10-02 Thread Steve Willoughby
On 02-Oct-10 10:32, Emile van Sebille wrote: File "my_turtle.py", line 19 if (abs(turtle.position()[0])> turtle.window_height()/2) or ^ SyntaxError: invalid syntax How does Python know that the next line is the continuation of your if statement, instead of the beginning of a new line of code?

Re: [Tutor] function error

2010-10-02 Thread Emile van Sebille
On 10/2/2010 10:45 AM Steve Willoughby said... On 02-Oct-10 10:32, Emile van Sebille wrote: Well, not really -- this is the OPs code. I was responding to Joel's comment of not seeing the entire post. File "my_turtle.py", line 19 if (abs(turtle.position()[0]) > turtle.window_height()/2) or

Re: [Tutor] function error

2010-10-02 Thread roberto
On Sat, Oct 2, 2010 at 7:45 PM, Steve Willoughby wrote: > On 02-Oct-10 10:32, Emile van Sebille wrote: >>> >>> File "my_turtle.py", line 19 >>> if (abs(turtle.position()[0])> turtle.window_height()/2) or >>> ^ >>> SyntaxError: invalid syntax > > How does Python know that the next line is the conti

Re: [Tutor] Using contents of a document to change file names

2010-10-02 Thread Joel Goldstick
On Sat, Oct 2, 2010 at 1:18 PM, Emile van Sebille wrote: > On 10/2/2010 8:56 AM Josep M. Fontana said... > > Hi, >> >> This is my first posting to this list. Perhaps this has a very easy answer >> but before deciding to post this message I consulted a bunch of Python >> manuals and on-line refer

[Tutor] Networking

2010-10-02 Thread Chris King
Dear Tutors, I have attached my 2 programs for networking. It uses socket and SocketServer, but it just simplifies it even more. The problem is it won't work. The Client raises the error, (with trace back) Traceback (most recent call last): File "G:\My Dropbox\My Dropbox\Chris\Not done\c

Re: [Tutor] Networking

2010-10-02 Thread Evert Rol
> Dear Tutors, > I have attached my 2 programs for networking. It uses socket and > SocketServer, but it just simplifies it even more. The problem is it won't > work. The Client raises the error, (with trace back) > Traceback (most recent call last): > File "G:\My Dropbox\My Dropbox\Chris\N

Re: [Tutor] function error

2010-10-02 Thread ALAN GAULD
> ## > import turtle, random > > def checkForward(distance): > old_position = turtle.position() > turtle._pen.up() > turtle.forward(distance) > forward_failed = outOfBounds() you set forward faile

[Tutor] how to learn python from scratch, (for simpe people)?

2010-10-02 Thread a a
Dear Friends, I am writing for some assistence from an expert. I give you a short background to understand my need. (for your information I work with a macbook normally), but I do have desktop in Microsoft) I am not a programmer. My work has to do with old manuscripts and Philosophy. But recent

Re: [Tutor] data question

2010-10-02 Thread ALAN GAULD
> I think this is what can work : http://www.daniweb.com/code/snippet216750.html > > I will try it. Good, that is exactly the kind of struicture I had in mind. Just put the data structure in a module, forget about the code and import it to the >>> prompt and play with it till you are sure you

Re: [Tutor] Getting total counts (Steven D'Aprano)

2010-10-02 Thread aeneas24
Thanks very much for the extensive comments, Steve. I can get the code you wrote to work on my toy data, but my real input data is actually contained in 10 files that are about 1.5 GB each--when I try to run the code on one of those files, everything freezes. To solve this, I tried just havi

Re: [Tutor] how to learn python from scratch, (for simpe people)?

2010-10-02 Thread Emile van Sebille
On 10/2/2010 8:22 AM a a said... Dear Friends, I am writing for some assistence from an expert. I give you a short background to understand my need. (for your information I work with a macbook normally), but I do have desktop in Microsoft) I am not a programmer. My work has to do with old manus

Re: [Tutor] how to learn python from scratch, (for simpe people)?

2010-10-02 Thread Emile van Sebille
On 10/2/2010 4:21 PM Emile van Sebille said... On 10/2/2010 8:22 AM a a said... Now my questions: 1) Is python enough and complete to build a simple program of the kind deskribed above? Yes 2) Will I be able to build standalone program with it? Yes Sorry - Forget to answer your questions

Re: [Tutor] Connecting my users

2010-10-02 Thread Steven D'Aprano
On Sat, 2 Oct 2010 08:06:14 pm Timo wrote: > 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 interacti

Re: [Tutor] data question

2010-10-02 Thread Alan Gauld
"Roelof Wobben" wrote Perhaps a simple SQLlite database? 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. If you

Re: [Tutor] how to learn python from scratch, (for simpe people)?

2010-10-02 Thread Alan Gauld
"a a" wrote ...building a web site I did learn alone some html, dreamweaver, css But now I would like to go further, although remaining always an hobby. I would like to learn some programming, since I wish to build a program to run a database. Mybe more in the future if this goes well.

Re: [Tutor] list comprehension, efficiency?

2010-10-02 Thread Steven D'Aprano
On Sun, 3 Oct 2010 01:17:39 am bob gailer wrote: > I ran dis on a for loop and the equivalent comprehension. > > I was surprised to see almost identical code. > > I had assumed (and now wish for) that a comprehension would be a > primitive written in C and thus much faster! How could it be? A lis

Re: [Tutor] Getting total counts (Steven D'Aprano)

2010-10-02 Thread Alan Gauld
wrote I can get the code you wrote to work on my toy data, but my real input data is actually contained in 10 files that are about 1.5 GB each--when I try to run the code on one of those files, everything freezes. Fot those kind of volumes I'd go for a SQL database every time! (SQLlite might

[Tutor] Smart posting - Was: Re: Tutor Digest, Vol 80, Issue 11

2010-10-02 Thread Alan Gauld
"Edward Lang" wrote As the standard header advice says in the very mail that you posted: When replying, please edit your Subject line so it is more specific than "Re: Contents of Tutor digest..." And also Today's Topics: 1. Re: Connecting my users (Timo) 2. Re: data question (Al

Re: [Tutor] Using contents of a document to change file names

2010-10-02 Thread Alan Gauld
"Josep M. Fontana" wrote Here's the problem I want to solve. I have a lot of files with the following name structure: A-01-namex.txt Then I have another text file containing information about the century each one of the texts was written. This document has the following structure: A-01

Re: [Tutor] Getting total counts (Steven D'Aprano)

2010-10-02 Thread Steven D'Aprano
On Sun, 3 Oct 2010 08:29:29 am aenea...@priest.com wrote: > Thanks very much for the extensive comments, Steve. I can get the > code you wrote to work on my toy data, but my real input data is > actually contained in 10 files that are about 1.5 GB each--when I try > to run the code on one of those

Re: [Tutor] Smart posting - Was: Re: Tutor Digest, Vol 80, Issue 11

2010-10-02 Thread James Mills
On Sun, Oct 3, 2010 at 10:11 AM, Alan Gauld wrote: > Please, do not post the entire digest. We don't have time to wade through it > looking for the few lines you may have added or commented upon. I'm actually really surprised anyone actually uses and subscribes to mailing lists and wants to get d

Re: [Tutor] (de)serialization questions

2010-10-02 Thread Steven D'Aprano
On Sat, 2 Oct 2010 04:08:22 am Albert-Jan Roskam wrote: > Maybe my main question is as follows: what permanent object is most > suitable to store a large amount of entries (maybe too many to fit > into the computer's memory), which can be looked up very fast. "Very fast" and "cannot fit in main m

[Tutor] retrieve google translate sound files through python

2010-10-02 Thread Norman Khine
does anyone know how i can extend this example http://stackoverflow.com/questions/1136604/how-do-i-use-the-json-google-translate-api and be able to download the sound file produced by the translation? thanks norman -- ˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ ǝǝs noʎ 'ʇuǝɯɐן sǝɯıʇ ǝɥʇ puɐ 'ʇuǝʇuoɔ ǝq s,ʇǝן