Re: [Tutor] role playing game - help needed

2010-12-07 Thread Alan Gauld
"Al Stern" wrote attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 How do I set the variable for available_points? available_points = MAX_POINTS - (not sure what goes here) Check the mail from Robert Sjoblom, he gives you the necessary clues. You can c

Re: [Tutor] Python vs. MATLAB

2010-12-07 Thread Robert Sjöblom
> Joel Schwartz wrote: >> Chris, >> >> Can you say more about number (7) in your list? What does "pass by value" >> mean and what are the alternatives? > > Oh boy, is that a can of worms... and this is going to be a long post. > You might want to go make yourself a coffee first :) [snipped wall of

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Robert Sjöblom
>> Thanks for the advice. I think I have the dictionary function set up right >>> now although I'm still not clear why it is better than the list. >>> >>> attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} >>> >> >> Consider where you want to update the points for "health" >> >

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Robert Sjöblom
>> attributes["strength"] = input("\nHow many points do you want to >> assign to >> strength?: ") >> >> Please let me know if this isn't advisable.  It seems to work on the >> surface. > > Close, but remember that input() returns a string. You need numbers > so you need to convert strings to intege

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Peter Otten
Robert Sjöblom wrote: >> Close, but remember that input() returns a string. You need numbers >> so you need to convert strings to integers. > > Actually, input() only accept integers, consider the following: input("input: ") > input: d > > Traceback (most recent call last): > File "", line

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Al Stern
Apologies for all my questions. Up to this point I have been able to work out most of the challenges but I seem to have hit a wall. Can't seem to make any progress and completely frustrated. I looked at the 11/21 discussion. From the documentation, I realized I needed to set the variables to vi

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Peter Otten
Al Stern wrote: > Apologies for all my questions. Up to this point I have been able to work > out most of the challenges but I seem to have hit a wall. Can't seem to > make any progress and completely frustrated. > > I looked at the 11/21 discussion. From the documentation, I realized I > need

Re: [Tutor] Python vs. MATLAB

2010-12-07 Thread Joel Schwartz
Steven, Thanks for taking the time to write such a detailed and illuminating response! I learned programming in Pascal in college in the early 1980s and used Fortran in grad school in the late 80s. That was pretty much the end of my contact with programming until I began learning R last year and

[Tutor] Save file in a specific directory

2010-12-07 Thread Susana Iraiis Delgado Rodriguez
I make a script to redirect a txt file from an external directory, but in this directory I don't have permission to write, just to read data. So I make this module: import os, time,fnmatch from xlwt import Workbook from osgeo import ogr,gdal,osr from dbf import * gdal.AllRegister() file_list = [] f

Re: [Tutor] Save file in a specific directory

2010-12-07 Thread Susana Iraiis Delgado Rodriguez
My other message was incomplete, it was a mistake: This is the correct one 2010/12/7 Susana Iraiis Delgado Rodriguez > I make a script to redirect a txt file from an external directory, but in > this directory I don't have permission to write, just to read data. So I > make this module: > import

Re: [Tutor] Python vs. MATLAB

2010-12-07 Thread Sander Sweers
On 7 December 2010 00:16, Steven D'Aprano wrote: > Oh boy, is that a can of worms... and this is going to be a long post. You > might want to go make yourself a coffee first :) Great writeup and much appreciated :-). Thx Sander ___ Tutor maillist - T

Re: [Tutor] Save file in a specific directory

2010-12-07 Thread Joel Goldstick
On Tue, Dec 7, 2010 at 12:20 PM, Susana Iraiis Delgado Rodriguez < susana.delgad...@utzmg.edu.mx> wrote: > My other message was incomplete, it was a mistake: This is the correct one > > 2010/12/7 Susana Iraiis Delgado Rodriguez > > I make a script to redirect a txt file from an external director

Re: [Tutor] Save file in a specific directory

2010-12-07 Thread Jerry Hill
> When I run the script I got the next error: import crawler_shp > Traceback (most recent call last): >   File "", line 1, in >   File "crawler_shp.py", line 105, in >     dbf = Dbf(d,new=False) >   File "C:\Python26\lib\site-packages\dbf.py", line 125, in __init__ >     self.stream = file(f

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Al Stern
Tried to use the documentation but still getting the errors... The 1st one has to do with the available_points # set variables attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 available_points = MAX_POINTS - attributes.values() keys = attributes.keys() values

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Adam Bark
On 07/12/10 22:10, Al Stern wrote: Tried to use the documentation but still getting the errors... The 1st one has to do with the available_points # set variables attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 available_points = MAX_POINTS - attributes.value

[Tutor] calling a method within a function

2010-12-07 Thread John
Hello, I have a strange problem with a piece of code I've written. It's a bit overly complicated to make an example with, but the gist is below. But in the example below, it works. However, in my example, when I call the method from within the function, it returns something other than what I expec

Re: [Tutor] calling a method within a function

2010-12-07 Thread Adam Bark
On 07/12/10 22:36, John wrote: Hello, I have a strange problem with a piece of code I've written. It's a bit overly complicated to make an example with, but the gist is below. But in the example below, it works. However, in my example, when I call the method from within the function, it returns

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Peter Otten
Al Stern wrote: > I used the following code and got the following error. The result of input is always a string. > attributes["strength"] = input("\nHow many points do you want to assign to > strength?: ") Say you type 42 when you run your script. Then the above assignment is effectively at

Re: [Tutor] calling a method within a function

2010-12-07 Thread Alan Gauld
"John" wrote I have a strange problem with a piece of code I've written. It's a bit overly complicated to make an example with, but the gist is below. But in the example below, it works. However, in my example, when I call the method from within the function, it returns something other than