newbie, help with pythonpath

2005-03-03 Thread Eduardo Suarez
Hi all,
In order not to make a mess my system, i have installed a packaged 
called pygtkglext in /usr/local/pygtkglext instead of /usr/local (using 
the --prefix in ./configure).

Hence, i have the directories
/usr/local/pygtkglext-1.0.1/lib/python2.3/site-packages/gtk-2.0/gtk/gtkgl
/usr/local/pygtkglext-1.0.1/lib/python2.3/site-packages/gtk-2.0/gtk/gdkgl
with the python packages i have compiled.
I'm trying to set the python path variable so i can use them, but i 
haven't got it. Any hint?

I have also installed the gtk package in:
/usr/lib/python2.3/site-packages/gtk-2.0/gtk
Is there a way to make it work?
Thanks a lot,
-Eduardo
--
http://mail.python.org/mailman/listinfo/python-list


Re: newbie, help with pythonpath

2005-03-04 Thread Eduardo Suarez
What do i need to add to the path? I have already tried the same with 
the PYTHONPATH variable.

Thanks in advance,
-Eduardo
[otto:eduardo/ 501]$ python
Python 2.3.5 (#2, Feb  9 2005, 00:38:15)
[GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/usr/local/pygtkglext-1.0.1')
>>> import gtk.gtkgl
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>> sys.path.append('/usr/local/pygtkglext-1.0.1/lib')
>>> import gtk.gtkgl
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>> sys.path.append('/usr/local/pygtkglext-1.0.1/lib/python2.3')
>>> import gtk.gtkgl
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>> 
sys.path.append('/usr/local/pygtkglext-1.0.1/lib/python2.3/site-packages')
>>> import gtk.gtkgl
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>> 
sys.path.append('/usr/local/pygtkglext-1.0.1/lib/python2.3/site-packages/gtk 
-2.0')
>>> import gtk.gtkgl Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>> 
sys.path.append('/usr/local/pygtkglext-1.0.1/lib/python2.3/site-packages/gtk 
-2.0/gtk')
>>> import gtk.gtkgl Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>> 
sys.path.append('/usr/local/pygtkglext-1.0.1/lib/python2.3/site-packages/gtk 
-2.0/gtk/gtkgl')
>>> import gtk.gtkgl Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gtkgl
>>>

Chmouel Boudjnah wrote:
Eduardo Suarez wrote:
I'm trying to set the python path variable so i can use them, but i 
haven't got it. Any hint?

sys.path.append('/usr/blah/blah/blah/directory')
--
http://mail.python.org/mailman/listinfo/python-list


Re: copy on write

2012-01-13 Thread Eduardo Suarez-Santana

El 13/01/12 11:33, Eduardo Suarez-Santana escribió:

I wonder whether this is normal behaviour.


Even simpler:

$ python
Python 2.7.2 (default, Oct 31 2011, 11:54:55)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> r={'a':1};
>>> d={};
>>> d['x']=r;
>>> d['y']=r;
>>> d['x']['a']=3
>>> d['y']
{'a': 3}
>>>

--
http://mail.python.org/mailman/listinfo/python-list


copy on write

2012-01-13 Thread Eduardo Suarez-Santana

I wonder whether this is normal behaviour.

I would expect equal sign to copy values from right to left. However, it 
seems there is a copy-on-write mechanism that is not working.


Anyone can explain and provide a working example?

Thanks,
-Eduardo

$ python
Python 2.7.2 (default, Oct 31 2011, 11:54:55)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class n:
... def __init__(self, id, cont):
... self.id = id;
... self.cont = cont;
...
>>> r={'a':1};
>>> d={};
>>> d['x']=r;
>>> d['y']=r;
>>> x1 = n('x',d['x']);
>>> y1 = n('y',d['y']);
>>> x1.cont['a']=2;
>>> y1.cont
{'a': 2}
>>>

--
http://mail.python.org/mailman/listinfo/python-list