[Tutor] Looking for an open source project

2006-04-13 Thread Dave S
Hi all, I have been playing around with Python for a while now and am looking for open source KDE projects written in Python that I can help with / learn from. Something relatively simple that uses Qt. (I am still a bit green) Any idea where I can get a list of projects. I checked out sourcefo

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Steve Nelson
On 4/13/06, Matthew Singletary <[EMAIL PROTECTED]> wrote: > I'm NOT looking for any answers, just some tips to an _elegant_ method to > solve this. My tutor/mentor and I wrote a chess program a while back - diaganols were the hardest bit to get working! Essentially diagonals are treated as thoug

[Tutor] sqlobject behavior

2006-04-13 Thread Tiago Saboga
Hi! I don't understand why sqlobject's ForeignKey attribute has to have the same name of the linked class. The following example doesn't work (the traceback is just after) unless I rename the 'p' attribute of 'Address' class as 'person'. Thanks, Tiago. class Person(SQLObject): name = Str

Re: [Tutor] Python video?

2006-04-13 Thread Danny Yoo
> I find Python411 an excellent podcast about Python: > http://www.awaretek.com/python/index.html > > and on general topics about IT: > http://www.itconversations.com/ Before its untimely demise, Dr Dobbs Journal used to do a lot with Technetcast: http://technetcast.ddj.com/ The site st

Re: [Tutor] Python video?

2006-04-13 Thread francois schnell
Hello,I find Python411 an excellent podcast about Python:http://www.awaretek.com/python/index.html and on general topics about IT: http://www.itconversations.com/francoisOn 14/04/06, Steve Nelson < [EMAIL PROTECTED]> wrote:On 4/13/06, Danny Yoo < [EMAIL PROTECTED]> wrote:>>> On Wed, 12 Apr 2006, Ho

Re: [Tutor] failing to learn python

2006-04-13 Thread Carroll, Barry
Alan: As always, you make excellent points. Actually, there isn't much on which we disagree here, I think. I did not mean that other engineering disciplines necessarily employ less craftsmanship than does software. On the contrary, excellent craftsmanship can be found in all branches of engineer

Re: [Tutor] Python video?

2006-04-13 Thread w chun
> > > I read this week on this forum about a kind of Python video in its > > > website. Which view is that, and where could I find it? > > > > It's a video with gushing praise over Python, made in the style of a Monty > > Python skit. > > On a similar line, I've recently discovered "podcasts". >

Re: [Tutor] Python video?

2006-04-13 Thread Steve Nelson
On 4/13/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Wed, 12 Apr 2006, Hoffmann wrote: > > > I read this week on this forum about a kind of Python video in its > > website. Which view is that, and where could I find it? I search in > > Python website, but I didn't find it. Is it a 'demo' of th

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Matthew Singletary
Thanks for the input from everyone,I had been working with a flat array and checking the horizontals and verticals with slices and mod math but I think the tuple approach would be pretty easy to change to use. I can't ever recall being interested in a test from a test suite but my interest is pique

Re: [Tutor] Databases

2006-04-13 Thread mhansen
I just googled "foxpro python" and this link will probably help. http://mail.python.org/pipermail/db-sig/2001-May/001782.html I also posted a link a couple of days ago that has a nice PDF of the Python DB-API which I hope the ODBC driver mentioned in the mail message above uses. Mike - Orig

[Tutor] Databases

2006-04-13 Thread John Corry
Hi, I have some database files that are written in visual foxpro. I want to be able to access them, read them and amend them. Can I do this with python? Are there any good links or websites that would specifically deal with interrogating visual foxpro databases with Python? I have limited know

Re: [Tutor] failing to learn python

2006-04-13 Thread Alan Gauld
> has been very interesting. It illustrates the fact that software > engineering remains very much a craft. As with all crafts, is heavily > influenced by the preferences (style if you will) of the individual > artisan. There are very few 'right or wrong' answers here. Oops, you hit a hot button

Re: [Tutor] Force a value to int

2006-04-13 Thread Alan Gauld
> Is there a particular way to force a value to be an int by either > converting it with int() or returning a default value. I don't think it exists. I think that would be a difficult thing to do in a generic way. The potential for inadvertant data loss is very high. > I've ended up writing my o

Re: [Tutor] Explanation of Lists data Type

2006-04-13 Thread Alan Gauld
>> list [-3:3] >> which is an error but is not reported as such, rathger it returns an >> empty list! > > I don't think this is an error, and whether it returns an empty list or > not depends on the length of the list: I stand corrected, and yes when you think about it, it makes sense. > print

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Danny Yoo
> I'm building a genetic algorithm to solve the queen placement problem, > the complicated stuff I can do on my own, but I'm not getting one part. > suppose the queen is on a square, I can check that it is in the same row > or same col but the diagonals, are less straight-forward. I know I could

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Tim Peters
[Matthew Singletary] >> I'm building a genetic algorithm to solve the queen placement problem, >> the complicated stuff I can do on my own, but I'm not getting one >> part. >> suppose the queen is on a square, I can check that it is in the same >> row or same col but the diagonals, are less straigh

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Python
On Thu, 2006-04-13 at 15:16 -0400, Matthew Singletary wrote: > I'm building a genetic algorithm to solve the queen placement problem, > the complicated stuff I can do on my own, but I'm not getting one > part. > suppose the queen is on a square, I can check that it is in the same > row or same co

Re: [Tutor] checking diagonals on a chessboard

2006-04-13 Thread Andre Roberge
On 4/13/06, Matthew Singletary <[EMAIL PROTECTED]> wrote: > > first, A disclaimer: > This isn't directly homework but is related to an assignment of mine > > I'm building a genetic algorithm to solve the queen placement problem, the > complicated stuff I can do on my own, but I'm not getting one pa

[Tutor] checking diagonals on a chessboard

2006-04-13 Thread Matthew Singletary
first, A disclaimer: This isn't directly homework but is related to an assignment of mine   I'm building a genetic algorithm to solve the queen placement problem, the complicated stuff I can do on my own, but I'm not getting one part.  suppose the queen is on a square, I can check that it is in th

Re: [Tutor] failing to learn python

2006-04-13 Thread Hoffmann
--- "Carroll, Barry" <[EMAIL PROTECTED]> wrote: > Greetings: > > The discussion surrounding this topic (by Payal, > Kent, Alan and others) > has been very interesting. It illustrates the fact > that software > engineering remains very much a craft. As with all > crafts, is heavily > influenced b

Re: [Tutor] Python video?

2006-04-13 Thread Danny Yoo
On Wed, 12 Apr 2006, Hoffmann wrote: > I read this week on this forum about a kind of Python video in its > website. Which view is that, and where could I find it? I search in > Python website, but I didn't find it. Is it a 'demo' of the language? It's a video with gushing praise over Python,

Re: [Tutor] failing to learn python

2006-04-13 Thread Carroll, Barry
Greetings: The discussion surrounding this topic (by Payal, Kent, Alan and others) has been very interesting. It illustrates the fact that software engineering remains very much a craft. As with all crafts, is heavily influenced by the preferences (style if you will) of the individual artisan. T

[Tutor] Show us some code

2006-04-13 Thread David Holland
John,Can you please post your code and the exact error message. First they came for the Danes, but I did not speak out because I am not a Dane. Yahoo! Messenge

Re: [Tutor] Problems when displaying numbers

2006-04-13 Thread Patricia
> An example of result before the call to calc_numbers is: [50L, -1, 1, -1] An example of result before the call is: [50L, -1L, 1L, -1L] Sorry about that. Thanks, Patricia ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listin

Re: [Tutor] Meaning of %g ?

2006-04-13 Thread Alan Gauld
> What is the exact meaning of %g in Python ? Same as in C. Its the shorter of the Scientific notation (%e) or Floating Point(%f) representations. In 20 years of using C I've never needed it, I wouldn't worry too much! :-) >From Python ducumentation: > %g: Same as "e" if exponent is greater

Re: [Tutor] Force a value to int

2006-04-13 Thread Kent Johnson
Ed Singleton wrote: > Is there a particular way to force a value to be an int by either > converting it with int() or returning a default value. > > I've ended up writing my own function to do it, but it seems like the > kind of thing that would be built-in somewhere. No, there is no built-in for

Re: [Tutor] Can anyone help me plz

2006-04-13 Thread Kent Johnson
John Brokaw wrote: > I'am very new to pygame, and python and any help would help me so much thx. > I have no idea whats wrong the chimp.py ex. works perfect, but when I > get to http://rene.f0o.com/mywiki/*LECTURETHREE* > *, *I get so stuck becuz the > ca

Re: [Tutor] Problems when displaying numbers

2006-04-13 Thread Patty
Hi: >it would be really helpful to see an example of 'result' before and >after the call to calc_numbers() as well as the code for calc_numbers if >possible. An example of result before the call to calc_numbers is: [50L, -1, 1, -1] an example after the call is: [50L, 25, ' ', 25] the code

[Tutor] Force a value to int

2006-04-13 Thread Ed Singleton
Is there a particular way to force a value to be an int by either converting it with int() or returning a default value. I've ended up writing my own function to do it, but it seems like the kind of thing that would be built-in somewhere. Ed ___ Tutor m

Re: [Tutor] Explanation of Lists data Type

2006-04-13 Thread Roel Schroeven
Alan Gauld schreef: > list [-3:3] > > which is an error but is not reported as such, rathger it returns > an empty list! I don't think this is an error, and whether it returns an empty list or not depends on the length of the list: >>> for i in range(10): print i, range(i)[-3:3]

Re: [Tutor] String question.

2006-04-13 Thread Adam
How's this?: >>> s = """All, ... ... I have a problem/question I'd like to pose to you guys on how best to ... accomplish the following. I have a string that will vary in size, what ... I would like to do is split into n size chunks. I am also not sure how ... best to represent the chunks. For e

[Tutor] Can anyone help me plz

2006-04-13 Thread John Brokaw
I'am very new to pygame, and python and any help would help me so much thx. I have no idea whats wrong the chimp.py ex. works perfect, but when I get to http://rene.f0o.com/mywiki/LECTURETHREE, I get so stuck becuz the call window = pygame.display.set_mode((468, 60)) makes a window like it should

Re: [Tutor] underscore function

2006-04-13 Thread Pujo Aji
Python programmers prefer to use name convention to make method of class "looks" private.Usually they use of '_' before the private method or private attribute name.This private method like the one you mentioned def _abc is not intentionaly used outside the class other then it is used among other c

Re: [Tutor] underscore function

2006-04-13 Thread Tim Golden
[linda.s] | I got a sample code and found some | function definition looks like def _abc | There is one underscore before the function name "abc", | what does it mean? It's a convention which indicates to any user of the code (including the original developer) that the function is not intended to

[Tutor] Meaning of %g ?

2006-04-13 Thread Sean Lee
What is the exact meaning of %g in Python ?   From Python ducumentation:   %g: Same as "e" if exponent is greater than -4 or less than precision, "f" otherwise.   But if %.mg is used, I don't see the rules. See the following example:   So here it follows the above rule:   >>> print "%.16g" % 0.00

[Tutor] underscore function

2006-04-13 Thread linda.s
I got a sample code and found some function definition looks like def _abc There is one underscore before the function name "abc", what does it mean? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor