Re: How is AI implemented

2008-01-03 Thread montyphyton
On Jan 3, 6:49 pm, "Martin Marcher" <[EMAIL PROTECTED]> wrote: > Hi, > > I know it's not a trivial field but I had some readings about > artificial intelligence lately and my personal conclusion is that it's > mostly just statistics. > > Naively explained: > > continiously gather and store informat

Re: list in a tuple

2007-12-27 Thread montyphyton
Carl Banks wrote: > On Dec 27, 12:38 pm, [EMAIL PROTECTED] wrote: >> After some tought I must agree that this is a wart more than >> a bug and that it will probably be best not to mess with it. >> However, what do you guys think about the print wart in Py3k >> described >> athttp://filoxus.blogspo

Re: list in a tuple

2007-12-27 Thread montyphyton
On Dec 27, 8:20 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > > > From that post: > > Ok, I do admit that doing > > > > a = ([1], 2) > > a[0].append(2) > > > > also doesn't throw an error, but this only confuses me more. > > > Why? You mutate thelist, but thetupledoes not chan

Re: list in a tuple

2007-12-27 Thread montyphyton
After some tought I must agree that this is a wart more than a bug and that it will probably be best not to mess with it. However, what do you guys think about the print wart in Py3k described at http://filoxus.blogspot.com/2007/12/python-3000-how-mutable-is-immutable.html#links (im not trying to

Re: list in a tuple

2007-12-24 Thread montyphyton
Like I said, it is clear *why* this happens, what I am concerned is if this what we *want* to happen, i.e., if the current situation is satisfying. Your mytuple class would be something that resembles a solution, my question is what the people on this group think about it. On Dec 24, 5:08 pm, Arna

list in a tuple

2007-12-24 Thread montyphyton
Recently, I got into a debate on programming.reddit.com about what should happen in the following case: >>> a = ([1], 2) >>> a[0] += [3] Currently, Python raises an error *and* changes the first element of the tuple. Now, this seems like something one would want to change - why raise an error *an

Re: Sorting dict keys

2007-07-21 Thread montyphyton
On 21 srp, 02:31, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 20 Jul 2007 15:27:51 -0700, montyphyton wrote: > >>>> b = a.keys() > >>>> b.sort() > > [1, 2, 3] > > > Works fine, but I would really like it if I could somehow do it

Re: Sorting dict keys

2007-07-20 Thread montyphyton
On 21 srp, 00:47, Duncan Smith <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Consider the following: > > a = {1:2, 3:4, 2:5} > > > Say that i want to get the keys of a, sorted. First thing I tried: > > b = a.keys().sort() > print b > > > None > > > Doesn't work. Probably be

Sorting dict keys

2007-07-20 Thread montyphyton
Consider the following: >>> a = {1:2, 3:4, 2:5} Say that i want to get the keys of a, sorted. First thing I tried: >>> b = a.keys().sort() >>> print b None Doesn't work. Probably because I am actually trying to sort the keys of the dictionary without copying them first. If that is the case, fin

Re: Determinant of Large Matrix

2007-06-06 Thread montyphyton
James Stroud je napisao/la: > Hello All, > > I'm using numpy to calculate determinants of matrices that look like > this (13x13): > > [[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.] > [ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.] > [ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4

Re: which "GUI module" you suggest me to use?

2007-06-06 Thread montyphyton
> This completely loses me; what do you mean by "draw its own icon", > and what does that have to do with rendering Web pages? maybe "draw its own icons" wasn't the best (or the most accurate way) of putting it. what i meant by that is this (from wikipedia): "Qt uses its own paint engine and cont

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread montyphyton
ZioMiP je napisao/la: > Hi to all... > > I'm actually using Tkinter for my GUI... but I need to "put a piece of a > web-page in a widget" how can I do? > > which GUI module do you suggest me to use for do that? > > or which GUI module do you suggest me to use at all? > > I'm acutally using Windows

Re: Who uses Python?

2007-06-05 Thread montyphyton
i use it for text mining, processing large text corpora for scientific purposes. i'm also working on some neat data mining tools written in python (called orange, in case someone's interested) walterbyrd je napisao/la: > I mean other than sysadmins, programmers, and web-site developers? > > I have

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread montyphyton
Méta-MCI je napisao/la: > Et le klingon ? > > Please, don't forget klingons > SVP, n'oubliez pas les klingons > > ;o) je pense que le klingon utilise les mems lettres comme l'anglais -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread montyphyton
> Agreed, but FWIW, if you compared Slavic-writing > people to Chinese-writing people, I would think that a > higher percentage of Slavic-writing people would be > bilingual in terms of their ability to write code in > non-Slavic alphabets, due to various > cultural/geographical factors. of course

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread montyphyton
Steve Howell je napisao/la: > some European alphabets: > >Spanish -- accented, includes digraphs ch and ll >German -- accented >French -- accented >Italian -- accented, no J/K/W/X/Y > what about slavic languages? in croatian you have five accented letters plus three letters for di

Re: how can I get the name of a method inside it?

2007-06-03 Thread montyphyton
> I would like to know if it's possible to retrieve the name of a method when > you're inside it. For example, in the following script, I would like to > assign _s so that it prints "you are in method1". > > > *** > class Obj1: > def __init__(self): >

PEP 8 style enforcing program

2007-05-31 Thread montyphyton
Some recent posts about Python programming style got me thinking. Since we have the PEP 8 which gives some guidelines about the style to be used, do we have any program that can check for violations of these guidelines within the source code? I understand that there are a lot of code beautifiers ou

writing to a file

2007-05-30 Thread montyphyton
as i understand there are two ways to write data to a file: using f.write("foo") and print >>f, "foo". what i want to know is which one is faster (if there is any difference in speed) since i'm working with very large files. of course, if there is any other way to write data to a file, i'd love to