Re: [Tutor] help, complete beginner please!

2010-08-27 Thread bob gailer
On 8/27/2010 9:42 PM, kevin hayes wrote: Hi all! I'm trying to write a basic text adventure game to start learning python (just for fun). I've gone through the first four chapters of a "learn python game programming book" and I'm having trouble with the exercise on writing a text adventure. I

Re: [Tutor] help, complete beginner please!

2010-08-27 Thread aug dawg
Now, I'm no pro at programming in Python, but here's what I recommend you do. I would have a class at the beginning to define all of the rooms, and then have the rest of the code below that. Then, it makes it easier to follow. In addition, I would also have a function that stores the name of the ro

[Tutor] help, complete beginner please!

2010-08-27 Thread kevin hayes
Hi all! I'm trying to write a basic text adventure game to start learning python (just for fun). I've gone through the first four chapters of a "learn python game programming book" and I'm having trouble with the exercise on writing a text adventure. I've been piecing together what is in the book

Re: [Tutor] exercise problem

2010-08-27 Thread Alan Gauld
"Dave Angel" wrote while teller < len(u): getal1 = u[teller] + v[teller] uitkomst = uitkomst + str(getal1) But then I get a list of string instead of integers. You're close. Now that you've initialized the result variable to [], you can use + just as you're doing. Just

Re: [Tutor] exercise problem

2010-08-27 Thread Dave Angel
Roelof Wobben wrote: Date: Fri, 27 Aug 2010 14:27:34 -0400 From: da...@ieee.org To: rwob...@hotmail.com CC: alan.ga...@btinternet.com; tutor@python.org Subject: Re: [Tutor] exercise problem The other problem is you're confusing the variables inside the function with the ones declared outside

Re: [Tutor] exercise problem

2010-08-27 Thread Francesco Loffredo
We are close to the solution, keep trying! On 27/08/2010 19.56, Roelof Wobben wrote: Hello, Now I have this : def add_vectors(u, v): """ >>> add_vectors([1, 0], [1, 1]) [2, 1] >>> add_vectors([1, 2], [1, 4]) [2, 6] >>> add_vectors([1, 2, 1], [1, 4, 3]) [2, 6, 4] >>> add_vectors([11, 0, -4,

Re: [Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
> Date: Fri, 27 Aug 2010 14:27:34 -0400 > From: da...@ieee.org > To: rwob...@hotmail.com > CC: alan.ga...@btinternet.com; tutor@python.org > Subject: Re: [Tutor] exercise problem > > (Don't top-post, it loses all the context) > > Roelof Wobben wrote: > > Hello, > > > > > > > > Now I have t

Re: [Tutor] exercise problem

2010-08-27 Thread Dave Angel
(Don't top-post, it loses all the context) Roelof Wobben wrote: Hello, Now I have this : def add_vectors(u, v): """ >>> add_vectors([1, 0], [1, 1]) [2, 1] >>> add_vectors([1, 2], [1, 4]) [2, 6] >>> add_vectors([1, 2, 1], [1, 4, 3]) [2, 6, 4]

Re: [Tutor] more on wx and tiff

2010-08-27 Thread Albert-Jan Roskam
Hi Wayne, Yep, I considered using PIL, but that package won't read so-called Group 4 Tiffs [1]. They're two-page, black-and-white scanned forms. I need part of the second form (i.e., the backside of a certificate). The page contains some hand-written info which needs to be presented in a simpl

Re: [Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
Hello, Now I have this : def add_vectors(u, v): """ >>> add_vectors([1, 0], [1, 1]) [2, 1] >>> add_vectors([1, 2], [1, 4]) [2, 6] >>> add_vectors([1, 2, 1], [1, 4, 3]) [2, 6, 4] >>> add_vectors([11, 0, -4, 5], [2, -4, 17, 0]) [13, -4, 13

Re: [Tutor] exercise problem

2010-08-27 Thread christopher . henk
Roelof Wobben wrote on 08/27/2010 12:18:01 PM: > > > > Date: Fri, 27 Aug 2010 12:00:23 -0400 > > From: bgai...@gmail.com > > To: rwob...@hotmail.com > > CC: tutor@python.org > > Subject: Re: [Tutor] exercise problem > > > > I have been reading your posts and responses. I find myself frustrated

Re: [Tutor] more on wx and tiff

2010-08-27 Thread Sander Sweers
On 27 August 2010 18:25, Albert-Jan Roskam wrote: > First, thanks for your previous replies. I cannot use IrfanView any time > soon, nor will my boss switch to Linux. Why not use graphicsmagick [1] which also provides a windows binary [2]. You can execute it with the subprocess [3] module? Greet

Re: [Tutor] exercise problem

2010-08-27 Thread Francesco Loffredo
On 27/08/2010 17.05, Roelof Wobben wrote: Hello, My first try : def add_vectors(u, v): """ >>> add_vectors([1, 0], [1, 1]) [2, 1] >>> add_vectors([1, 2], [1, 4]) [2, 6] >>> add_vectors([1, 2, 1], [1, 4, 3]) [2, 6, 4] >>> add_vectors([11, 0, -4, 5], [2, -4, 17, 0]) [13, -4, 13, 5] """ teller

Re: [Tutor] more on wx and tiff

2010-08-27 Thread Wayne Werner
On Fri, Aug 27, 2010 at 11:25 AM, Albert-Jan Roskam wrote: > Hi again, > > Some more questions about tiff conversion. > > First, thanks for your previous replies. I cannot use IrfanView any time > soon, nor will my boss switch to Linux. > Have you tried using the PIL? http://www.pythonware.com/p

Re: [Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
> Date: Fri, 27 Aug 2010 12:00:23 -0400 > From: bgai...@gmail.com > To: rwob...@hotmail.com > CC: tutor@python.org > Subject: Re: [Tutor] exercise problem > > I have been reading your posts and responses. I find myself frustrated > with your lack of understanding of Python fundamentals and t

[Tutor] more on wx and tiff

2010-08-27 Thread Albert-Jan Roskam
Hi again, Some more questions about tiff conversion. First, thanks for your previous replies. I cannot use IrfanView any time soon, nor will my boss switch to Linux. So I'm trying to do the conversion from tiff to png using the wx package (gif would also be fine, but that won't work due to

[Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
Hello, Thanks for pointing this out. I change it to this : def add_vectors(u, v): """ >>> add_vectors([1, 0], [1, 1]) [2, 1] >>> add_vectors([1, 2], [1, 4]) [2, 6] >>> add_vectors([1, 2, 1], [1, 4, 3]) [2, 6, 4] >>> add_vectors([11, 0, -4, 5],

Re: [Tutor] exercise problem

2010-08-27 Thread bob gailer
I have been reading your posts and responses. I find myself frustrated with your lack of understanding of Python fundamentals and the time and energy others are putting in that seems to help only a little. I recommend you take a very basic tutorial, and be sure you understand the basic concep

Re: [Tutor] exercise problem

2010-08-27 Thread Walter Prins
Hi Roelof, See below On 27 August 2010 16:05, Roelof Wobben wrote: > > uitkomst = add_vectors[u,v] > > But now I get this error message : > > > Traceback (most recent call last): > *File "C:\Users\wobben\workspace\oefeningen\src\test.py", line 27, in > * > > uitkomst = add_vectors[u,v] > > Type

Re: [Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
Hello, My first try : def add_vectors(u, v): """ >>> add_vectors([1, 0], [1, 1]) [2, 1] >>> add_vectors([1, 2], [1, 4]) [2, 6] >>> add_vectors([1, 2, 1], [1, 4, 3]) [2, 6, 4] >>> add_vectors([11, 0, -4, 5], [2, -4, 17, 0]) [13, -4, 13, 5

Re: [Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
Oke, That's also the point Alan is making. I try now to make the function and puttting it on this maillist if it's ready. Maybe I can learn more about efficient progamming or better way to do this. Roelof > From: st...@pearwood.info > To: tutor@python.org > Date: Sat, 28 Aug 201

Re: [Tutor] exercise problem

2010-08-27 Thread Steven D'Aprano
On Fri, 27 Aug 2010 08:23:06 pm Roelof Wobben wrote: > > > Write a function add_vectors(u, v) that takes two lists of > > > numbers [...] > My new idea is that u is the number which must be calculated and v is > the vector which containts the outcome or u is the outcome of the > first numbers and v

Re: [Tutor] exercise problem

2010-08-27 Thread Francesco Loffredo
On 27/08/2010 12.23, Roelof Wobben wrote: From: rwob...@hotmail.com To: alan.ga...@btinternet.com Subject: RE: [Tutor] exercise problem Date: Fri, 27 Aug 2010 07:04:39 + > To: tutor@python.org > From: alan.ga...@btint

Re: [Tutor] exercise problem

2010-08-27 Thread Roelof Wobben
From: rwob...@hotmail.com To: alan.ga...@btinternet.com Subject: RE: [Tutor] exercise problem Date: Fri, 27 Aug 2010 07:04:39 + > To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Thu, 26 Aug 2010 23:54:19 +0100 > Subject: Re: [Tutor] exercise problem > > "Roelof Wobb

Re: [Tutor] question about import statement

2010-08-27 Thread Peter Otten
Greg Bair wrote: > On 08/26/2010 10:29 PM, Hugo Arts wrote: >> On Thu, Aug 26, 2010 at 9:16 PM, Bill Allen wrote: >>> >>> I did try that and of course it gave an error because it was necessary. >>> I >>> just did not know why. However, I later found an explanation on the >>> web. Here it is: >

Re: [Tutor] question about import statement

2010-08-27 Thread Alan Gauld
"Bill Allen" wrote *from tkinter import * from tkinter import ttk These two lines tell Python that our program needs two modules. The first, "tkinter", is the standard binding to Tk, which when loaded also causes the existing Tk library on your system to be loaded. The second, "ttk", is Py