Re: [Tutor] Why does it display traceback info here and not there?

2009-05-30 Thread xbmuncher
Well you're right about the paths... print(os.getcwd())outputs when run from notepad++: c:\program files\Notepad++ when double clicked: actual directory path I'd like to use notepad++ to execute the scripts I edit, is there a way to solve this problem? On Sat, May 30, 2009 at 3:45 PM, Alan G

[Tutor] converting xls to csv

2009-05-30 Thread Nick Burgess
Hi list, I am trying to make this code work. I don't have any experience with defining things and this is my second program. The error returmed is "SyntaxError: invalid syntax" code: #!/usr/bin/python import cvs def convertXLS2CSV(aFile): '''converts a MS Excel file to csv w/ the same n

Re: [Tutor] Mapping to an equivalent / similar object?

2009-05-30 Thread Allen Fowler
> The difference between objects is measeured by their interfaces not their > data > so provided the supplier objects all use the same operations of a Flavor then > its not too bad. You can either create subclasses of Flavor for each > manufacturer that retuirns the requisite list of attrib

Re: [Tutor] Getting exposure to high quality Python code

2009-05-30 Thread vy
> From: Daniel Brown > > Can anyone recommend any ways of getting exposed to high quality > Python code? Have a look at (& contribute to) the source code of projects like http://www.sagemath.org/ Kind regards, -- Van Ly ___ Tutor maillist - Tutor@p

Re: [Tutor] Class Tips

2009-05-30 Thread W W
On Sat, May 30, 2009 at 8:20 PM, David wrote: > > Alan Gauld wrote: >> >> "David" wrote >> >>> I took this program that determines a fertilizer application rate; >>> ... >>> And converted it to class/object to learn how they work. Just looking for some pointers, if I did it correctly etc. >>> >>>

Re: [Tutor] Class Tips

2009-05-30 Thread David
Alan Gauld wrote: "David" wrote I took this program that determines a fertilizer application rate; ... And converted it to class/object to learn how they work. Just looking for some pointers, if I did it correctly etc. For such a small program its hard to see what else you could have done.

Re: [Tutor] String formatting hex numbers

2009-05-30 Thread Alan Gauld
"Tony Cappellini" wrote sys.stdout.write( "\r%-8s ... 0x%08X->0x%08X " % ( descr, long(startAddr), long(endAddr) ) Why are these displayed with a leading negative sign (between the 0x and the actual number)- as seen below? 0x-1BFFF400 to 0x-1BFFF000 Because they are negative values and th

Re: [Tutor] Class Tips

2009-05-30 Thread Alan Gauld
"David" wrote I took this program that determines a fertilizer application rate; ... And converted it to class/object to learn how they work. Just looking for some pointers, if I did it correctly etc. For such a small program its hard to see what else you could have done. Technically itys

[Tutor] String formatting hex numbers

2009-05-30 Thread Tony Cappellini
I was looking at a this code which uses this code to dsiplay some hex numbers sys.stdout.write( "\r%-8s ... 0x%08X->0x%08X " % ( descr, long(startAddr), long(endAddr) ) The hex values are in this range 0x1BFFF400 to 1BFFF000 Why are these displayed with a leading negative sign (between the 0x a

[Tutor] Class Tips

2009-05-30 Thread David
I took this program that determines a fertilizer application rate; #!/usr/bin/python rate = float(raw_input("Enter rate i.e. (0.5) : ")) n = float(raw_input("Enter N from bag i.e. (.14) : ")) app = rate / n area = 43.560 acre = input("Enter total acre's to be treated: ") bag = input("Enter bag w

Re: [Tutor] Using a list

2009-05-30 Thread David
David wrote: Alan Gauld wrote: "Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points f

Re: [Tutor] Using a list

2009-05-30 Thread David
Alan Gauld wrote: "Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribu

Re: [Tutor] Why does it display traceback info here and not there?

2009-05-30 Thread Alan Gauld
"xbmuncher" wrote Traceback (most recent call last): File "C:\path to file\script.py", line 1, in h = open('file2.dat', 'rb') File "C:\Python30\lib\io.py", line 278, in __new__ return open(*(args, **kwargs) File "C:\Python30\lib\io.py", line 222, in open closefd) File "C:\Python30\li

Re: [Tutor] Using a list

2009-05-30 Thread Alan Gauld
"Doug Reid" wrote The tutorial I'm using is discussing list, tuples, and dictionaries. ... four attributes: Strength,Stamina, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribute and put them bac

Re: [Tutor] Why does it display traceback info here and not there?

2009-05-30 Thread bob gailer
xbmuncher wrote: I have a script called: script.py and here are the contents: h = open('file2.dat', 'rb') data = h.read(1120) h.close() print(data) input("Press ENTER to exit") I am editing it in Notepad++ and I set it up so I can run in on python.exe (I have python30) from the program, it s

[Tutor] Why does it display traceback info here and not there?

2009-05-30 Thread xbmuncher
I have a script called: script.py and here are the contents: h = open('file2.dat', 'rb') data = h.read(1120) h.close() print(data) input("Press ENTER to exit") I am editing it in Notepad++ and I set it up so I can run in on python.exe (I have python30) from the program, it sends these parameter

[Tutor] Using a list

2009-05-30 Thread Doug Reid
The tutorial I'm using is discussing list, tuples, and dictionaries.  An exercise at the end wants me to do this:   Write a Character Creator program for a role-playing game. The player should be given a pool of 30 points to spend on four attributes: Strength,Stamina, Wisdom, and Dexterity. The

Re: [Tutor] lession 4.4 on finding prime number was: (no subject)

2009-05-30 Thread vy
> Date: Fri, 29 May 2009 09:46:17 -0500 > From: Gregory Morton > To: Tutor Newsgroup Python > Subject: [Tutor] (no subject) > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > I'm having a problem understanding how this code works in lesson 4.4 on the > python tutorial. Can any

Re: [Tutor] Docking Windows using Python

2009-05-30 Thread Alan Gauld
"Hi" wrote My program will have two windows. I want to be able to dock the two so they are side by side. I am wondering if this is doable in Python. Yes it is doable but how difficult it is will depend on the GUI toolkit you use. Most GUI programming environments nowadays (eg. .NET, Delph

Re: [Tutor] (no subject)

2009-05-30 Thread Alan Gauld
"Gregory Morton" wrote I'm having a problem understanding how this code works in lesson 4.4 on the python tutorial. Can you already program in another language? Say VB, Java or PHP? If not you would be better off with a different tutorial since rthe official one is really targeted at exper