I noticed my ipython-and-leo-editor session segfaulted right away when I added
/usr/lib/python2.5/site-packages/OCC
to the PYTHONPATH env variable.

So I just stopped using leo and made a vim file, test_paf.py, like below:
-----------------------------
from OCC.PAF.Context import ParametricModelingContext
from OCC.PAF.Parametric import Parameters
p = Parameters()
tutorial_context = ParametricModelingContext(p)
tutorial_context.init_display()

p.height = 33.3

p.radius = 22.9

tutorial_context.register_operations(tutorial_context.prim_operations)
my_cylinder = 
tutorial_context.prim_operations.MakeCylinderRH(p.radius,p.height,name="cylinder1",
 show=True)
-------------------------

Now, when I do:
python2.5 test_paf.py
I get:

$ /usr/bin/python2.5 test_paf.py
The Relation class needs the sympy library. Please check 
http://code.google.com/p/sympy/
could not find the resource:a148e300-5740-11d1-a904-080036aaa103.Location
MSG:/backups-650mb/pythonocc-read-only/src/contrib/GEOM/src/GEOMImpl/GEOMImpl_IShapesOperations.cpp
 [142] : 
GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations

[PAF] all operations registered
[PAF] ParametricModelingContext initialized
Traceback (most recent call last):
   File "test_paf.py", line 6, in <module>
     tutorial_context.init_display()
AttributeError: 'ParametricModelingContext' object has no attribute 
'init_display'


Some things are there. init_display cant be found.

Here is ipython  script run with 
PYTHONPATH="/usr/lib/python2.5/site-packages/OCC"

$ ipython  test_paf.py
Traceback (most recent call last):
   File "/usr/bin/ipython", line 26, in <module>
     import IPython.Shell
   File "/usr/lib/pymodules/python2.5/IPython/__init__.py", line 58, in <module>
     __import__(name,glob,loc,[])
   File "/usr/lib/pymodules/python2.5/IPython/ipstruct.py", line 22, in <module>
     from IPython.genutils import list2dict2
   File "/usr/lib/pymodules/python2.5/IPython/genutils.py", line 36, in <module>
     import tempfile
   File "/usr/lib/python2.5/tempfile.py", line 33, in <module>
     from random import Random as _Random
   File "/usr/lib/python2.5/random.py", line 43, in <module>
     from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as 
_ceil
ImportError: cannot import name log

Here is ipython script run with PYTHONPATH=""

$ ipython  -wthread test_paf.py
The Relation class needs the sympy library. Please check 
http://code.google.com/p/sympy/
could not find the resource:a148e300-5740-11d1-a904-080036aaa103.Location
MSG:/backups-650mb/pythonocc-read-only/src/contrib/GEOM/src/GEOMImpl/GEOMImpl_IShapesOperations.cpp
 [142] : 
GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations

[PAF] all operations registered
[PAF] ParametricModelingContext initialized
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/john/FABprojects/pythonocc-test/test_paf.py in <module>()
       4 p = Parameters()
       5 tutorial_context = ParametricModelingContext(p)
----> 6 tutorial_context.init_display()
       7
       8 p.height = 33.3

AttributeError: 'ParametricModelingContext' object has no attribute 
'init_display'
WARNING: Failure executing file: <test_paf.py>
Python 2.5.5 (r255:77872, Mar 20 2010, 04:09:06)
Type "copyright", "credits" or "license" for more information.

IPython 0.9.1.legacymaint.bzr.r1143 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.


John

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to