Re: [Tutor] Metaclass confusion...
Peter, >> ... the class, i. e. the instance of the metaclass with all its attributes >> has already been created by the type.__new__() method. If you move the >> manipulation of the members dict into a custom __new__() method you get >> the desired behaviour... Thank you! You've solved my problem and broadened my understanding :) Excellent examples as well. Love the class name too. -Modulok- ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] NLP
http://scikit-learn.sourceforge.net/ On Fri, Apr 8, 2011 at 6:52 AM, Ranjith Kumar wrote: > Hi all, > Can anyone suggest me any best Natural Language Processing in > python other than nltk. > -- > Cheers, > Ranjith Kumar K, > Chennai. > http://ranjithtenz.wordpress.com > > > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Latest Blog: http://jamesthornton.com/blog/how-to-get-to-genius ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] learnpython.org - Free Interactive Python Tutorial
Hey. I've created a website for learning Python interactively online. Check it out, and I would really appreciate it if you can also contribute tutorials. Thanks! -- -- Ron ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] jenia. cannot install mysqldb
Hello: I cannot get the mysqldb library to work. I'm trying to setup a Django project on Windows 7 using pydev in eclipse. There are the files I'm using: http://sourceforge.net/projects/mysql-python/ Now, for the life of me, I cannot get the mysqldb library to work. When I try to run the setup file, after the install windows tells me that there was a problem during install. I pointed the eclipse project to the mysqldb directory with all the setup.exe and all the other files. Of course it did not help. Can someone please help me? Thank you for your time and kind concern. Jenia___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] jenia. cannot install mysqldb
On Thu, Apr 21, 2011 at 9:35 AM, ivlev jenia wrote: > I cannot get the mysqldb library to work. > I'm trying to setup a Django project on Windows 7 using pydev in eclipse. > There are the files I'm using: http://sourceforge.net/projects/mysql-python/ > > Now, for the life of me, I cannot get the mysqldb library to work. > When I try to run the setup file, after the install windows tells me that > there was a problem during install. > I pointed the eclipse project to the mysqldb directory with all the > setup.exe and all the other files. > Of course it did not help. > Can someone please help me? Forgive my lack of experience with WIndows in general; However you'll likely need the MySQL C libraries and a compiler of some kind (Visual Studio / C++ ?) in order to install mysql-python from source... You're probably better off finding a pre-built binary distribution (or a pure python lirbary). Either way, you'll need MySQL install (at the very least mysqlxx.dll or something) cheers James -- -- James Mills -- -- "Problems are solved by method" ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] learnpython.org - Free Interactive Python Tutorial
hi Ron, this is great for beginners like me. Could you pls provide the link. tq Date: Wed, 20 Apr 2011 21:16:16 +0300 From: ron.rei...@gmail.com To: tutor@python.org Subject: [Tutor] learnpython.org - Free Interactive Python Tutorial Hey. I've created a website for learning Python interactively online. Check it out, and I would really appreciate it if you can also contribute tutorials. Thanks! -- -- Ron ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] list.__init__ within class definition
Hey there, In the following class definition: class Tomato(list): def __init__(self, data): list.__init__(self, data) The list.__init__ method (if it is a method, I'm not clear on what __init__ actually *is*) creates a list, right? In other words, l = Tomato([1,2,3]) will create a list l with the values [1,2,3], correct? Thanks, Alex ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] list.__init__ within class definition
On Thu, Apr 21, 2011 at 1:21 PM, Alex Companioni wrote: > In the following class definition: > > class Tomato(list): > def __init__(self, data): > list.__init__(self, data) > > The list.__init__ method (if it is a method, I'm not clear on what > __init__ actually *is*) creates a list, right? In other words, > > l = Tomato([1,2,3]) > > will create a list l with the values [1,2,3], correct? What you actually want is this: >>> class Tomato(list): ... def __init__(self, data): ... super(Tomato, self).__init__(data) ... >>> l = Tomato([1, 2, 3]) >>> l [1, 2, 3] >>> Your example: >>> class Tomato(list): ... def __init__(self, data): ... list.__init__(data) ... >>> l = Tomato([1, 2, 3]) >>> l [] >>> Do you see why ? cheers James -- -- James Mills -- -- "Problems are solved by method" ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] python timers
Hello how do you do. Today's question has to do with the time module. I want to add a timer to my gui. As I was messing around with it I found a way to measure time... but I'm positive there is a more elegant way to deal with this than what I've thrown together. def thing(): start = time.time() while 1: now = time.time() if now == start + 10.0: print "times up" How are timers usually implemented? By the way, I'm not really asking as much about the how (because I could throw something together that will serve my purpose), I'm asking more about conventions, like is there a standard way people implement timers, like does python come with one built in? Does every programmer who wants a timer write a different one? What is it about you... that intrigues me so? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor