Can't get the IPYthon ipapi object working

B

beetlecube

Hi , I found out from a random google search that I could use IPython
to automatically import modules so that I could test Django views.

I downloaded it (WIN XP), installed it. I'm able to import it, but I
just can't seem to get the object working.

The code:
-----------------------------------
try:
import IPython.ipapi
ip = IPython.ipapi.get()
a = ip.options
ip.ex('import os')

except Exception,msg:
print "Message: ", msg
-------------------------------------------

I get: ' Message: 'NoneType' object has no attribute 'options' '

If I remove the ip.options statement, it will say the same thing about
attribute 'ex'

Does anyone know if there are configuration options necessary?

I read the docs, and it described a profile module, but I just need
to run this, for this single purpose ( at least, now, later I can see
its usefulness definitely,)

Steve
 
R

Robert Kern

Hi , I found out from a random google search that I could use IPython
to automatically import modules so that I could test Django views.

I downloaded it (WIN XP), installed it. I'm able to import it, but I
just can't seem to get the object working.

The code:
-----------------------------------
try:
import IPython.ipapi
ip = IPython.ipapi.get()
a = ip.options
ip.ex('import os')

except Exception,msg:
print "Message: ", msg
-------------------------------------------

I get: ' Message: 'NoneType' object has no attribute 'options' '

If I remove the ip.options statement, it will say the same thing about
attribute 'ex'

This needs to be run in the context of a running instance IPython, not just any
other module. That kind of code is usually put into your c:\Documents and
Settings\username\_ipython\ipy_user_conf.py file.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,812
Messages
2,569,694
Members
45,478
Latest member
dontilydondon

Latest Threads

Top