[Ipython-tickets] [IPython] #139: Different behaviour: python vs. ipython when using a C module

IPython ipython-tickets@scipy....
Mon Apr 7 23:53:30 CDT 2008


#139: Different behaviour: python vs. ipython when using a C module
---------------------+------------------------------------------------------
 Reporter:  fperez   |        Owner:  fperez
     Type:  defect   |       Status:  new   
 Priority:  normal   |    Milestone:  0.9.0 
Component:  ipython  |      Version:        
 Severity:  normal   |   Resolution:        
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by yichun):

 I may be having a much simpler problem, simply trying to import sys in the
 C module and having problem with IPython:
 {{{
 #!c
 void module_start() {
         sprintf(buf, "sys.path.append('%s/lib/python')",
 get_module_home());
         assert(PyRun_SimpleString("import sys") == 0);
 }
 }}}
 Which runs fine in python but not in IPython with the following error:
 {{{
 ---------------------------------------------------------------------------
 exceptions.NameError                                 Traceback (most
 recent call last)

 /path/path/to/current/directory/<string>

 NameError: name 'sys' is not defined
 }}}

 Any insights?

-- 
Ticket URL: <http://ipython.scipy.org/ipython/ipython/ticket/139#comment:1>
IPython <http://ipython.scipy.org>
The IPython interactive Python system


More information about the Ipython-tickets mailing list