[Tutor] scope, visibility?

2010-11-01 Thread Samuel de Champlain
I am learning python. To practice, I am coding a hangman application in
pyGTK.
Here are my imports:

import pygtk
pygtk.require('2.0')
import gtk
import random

Here is my main class:

class PenduGTK:

Inside the class is a method with a bit of code:

def masque(chaine,liInd=0):

i = 0
lenght = len(chaine)

The offending line is the one with len(chaine)

Here are the error messages:

 penduGTK.py
Traceback (most recent call last):
  File "/home/xxx/bin/penduGTK.py", line 23, in enter_callback
self.lblMot.set_text(self.masque(self.motChoisi))
  File "/home/xxx/bin/penduGTK.py", line 44, in masque
lenght = len(chaine)
AttributeError: PenduGTK instance has no attribute '__len__'

I would think it has to do with namespaces, scopes and visibility. But how
do I refer to built-in functions from inside a class?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and sqlite

2010-01-31 Thread Samuel de Champlain
Thank you. I will read it next.
Here is another short one that I found:
http://www.wdvl.com/Authoring/python/SQLite/Watts07162009.html
If anyone knows of other tutorials on python and sqlite, please tell me of
them.


On Sun, Jan 31, 2010 at 11:08 PM, Victoria Wood <
cabbagetreecust...@gmail.com> wrote:

> Hi, I am very new to Python myself and decided to use sqlite so I could
> learn about gui programming. Although it has a lot of adverts on and is
> short I found this tutorial very useful
>
> http://www.devshed.com/c/a/Python/Using-SQLite-in-Python/
>
> I hope I have replied to this correctly.
>
> Victoria
>
> On Sun, Jan 31, 2010 at 11:03 AM, Samuel de Champlain <
> samueldechampl...@gmail.com> wrote:
>
> > My project is relatively light and postgresql or mysql might be overkill.
> > Does python work well with sqlite?
> > If so, can you point me towards the proper libraries and
> manuals/tutorials?
> > Thanks.
> >
> > __
> _
> > 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 maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] python and sqlite

2010-01-31 Thread Samuel de Champlain
My project is relatively light and postgresql or mysql might be overkill.
Does python work well with sqlite?
If so, can you point me towards the proper libraries and manuals/tutorials?
Thanks.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] I love python

2010-01-28 Thread Samuel de Champlain
I am presently doing the "Dive into Python tutorial", and I wanted to share
these lines with you.

"As a former philosophy major, it disturbs me to think that things disappear
when no one is looking at them, but that's exactly what happens in Python.
In general, you can simply forget about memory management and let
Pythonclean up after you. " - Mark Pilgrim

I love python.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Hello

2010-01-21 Thread Samuel de Champlain
This is my first message to this mailing list.
I want to create a project with glade and pygtk on fedora.
Can you suggest a good IDE?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor