ipython

Using IPython from the Python shell like `code.interact()`

Is it possible to use the IPython shell from an existing Python shell, as a shell-inside-a-shell, similarly to the built-in code.interact()? ...

django shell triggering Postgres idle transaction problems

It's not the fault of the django (iPython) shell, actually. The problem is developers who open the django shell ./manage.py shell run through some queries (it often only generates selects), and then either leave the shell running or somehow kill their (ssh) session (actually, I'm not sure if the latter case leaves the transaction open - ...

How to get unpickling to work with iPython?

Hello, I'm trying to load pickled objects in iPython. The error I'm getting is: AttributeError: 'FakeModule' object has no attribute 'World' Anybody know how to get it to work, or at least a workaround for loading objects in iPython in order to interactively browse them? Thanks edited to add: I have a script called world.py th...

IPython GUI (like IDLE)

Is there a GUI for IPython that allows me to open/run/edit Python files? My way of working in IDLE is to have two windows open: the shell and a .py file. I edit the .py file, run it, and interact with the results in the shell. Is it possible to use IPython like this? Or is there an alternative way of working? ...

drop into an interactive session to examine a failed unit test

I'd like to be able to enter an interactive session, preferably with IPython, if a unit test fails. Is there an easy way to do this? edit: by "interactive session" I mean a full Python REPL rather than a pdb shell. edit edit: As a further explanation: I'd like to be able to start an interactive session that has access to the context i...

Google App Engine, Python and IPython

I want to use IPython under GAE to debug scripts locally: import ipdb; ipdb.set_trace() but GAE restricts loading some modules from sys.path. Can I bypass this somehow? ...

Python shell and execfile scope

I'm working from inside an ipython shell and often need to reload the script files that contain my functions-under-construction. Inside my main.py I have: def myreload(): execfile("main.py") execfile("otherfile.py") Calling myreload() works fine if I have already ran in the same ipython session the execfile commands directly. ...

Use IPython as a testing framework

Is it possible to use IPython's log functionality to automate testing? For example, if I log an IPython session to a file is there a way to automatically replay this session and compare the output to the output of the original session? I would like to make several refactoring passes of my python code and replay this log file back to be...

ipython shell awk : Escaping "$" sign

Hi I am figuring out the Ipython shell support. Its seems awk doesn't work i.e following command !ls -l | awk '{print $1}' just prints "1". How do I pass the "$" sign correctly to shell. I am using zsh. Thanks Sandeep ...

Python: quickly loading 7 GB of text files into unicode strings

I have a large directory of text files--approximately 7 GB. I need to load them quickly into Python unicode strings in iPython. I have 15 GB of memory total. (I'm using EC2, so I can buy more memory if absolutely necessary.) Simply reading the files will be too slow for my purposes. I have tried copying the files to a ramdisk and th...

How to pause python execution in eclipse and return to an interactive prompt

I am using Eclipse as a Python IDE. Is there anyway for me to Debug my program and break to an interactive prompt. I am interested in exploring the existing data and running/testing commands. I believe there has to be a way, but I am so used to compiling languages that I have not been able to find where the options are. Any ideas? ...

Ambiguous tab completion not working in iPython on Windows

I am running IPython on Windows 7 x64 with pyreadline installed. If I start a new session and type: import numpy nu<TAB> Then nu autocompletes to numpy. However, if I start a new session and try this: import numpy n<TAB> Then nothing happens. I would expect it to cycle through all of the possible completions. I'm currently usin...

How to reload modules in django shell?

I am working with Django and use Django shell all the time. The annoying part is that while the Django server reloads on code changes, the shell does not, so every time I make a change to a method I am testing, I need to quit the shell and restart it, re-import all the modules I need, reinitialize all the variables I need etc. While iPyt...

How to configure ipy_user_conf.py to get IPython to to start with the right IDLE set as editor?

64-bit Vista Python 2.6 IPython 0.10 Also have Python 2.7 and 3.1 My ipy_user_conf.py has example lines showing how to set an editor. I've tried ipy_editors.idle() but [C:Python26/Scripts] |4>ed xxx.py Editing... > C:\Python26\lib\idlelib/idle.py "xxx.py" opens the IDLE for Python 3.1, and doesn't open xxx.py. I next imitated a s...

How to configure ipy_user_conf.py to get IPython to start logging right away?

64-bit Vista, Python 2.6, IPython 0.10 I want to try logging everything I do, so I set o.log = 1 in my ipy_user_conf.py . But logging doesn't start. It will if I enter "logstart" at the prompt. But what's the problem with 'o.log = 1'? ...

IPython threading server execfile()

My problem is the following: I would like to open an instance of ipython in a terminal of mine by simply typing, as usual: $ ipython -pylab and be able to have other processes order this ipython instance to execute a file as the execfile() would. This could be any other process, for instance, vim could ask ipython to run the currently...

Please Help: IPython for Emacs on Windows crashes

Questions Update: Why there is no In[1]: prompt? Please see the following output of IPython command line in Emacs. Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 0.10 -- An enhanced Interactive Python. ? -> Introduction and ove...

Any way to get a local timestamp in IPython prompt?

64-bit Vista Python 2.6 IPython 0.10 Is there a way to get a local timestamp in my IPython prompt. My current default prompt is [C:Python26/Scripts] |9> ...

django, python: reload function in shell

Hello, I work in the django IPython-shell, which can be started with manage.py shell. When i load an extern function in the shell for testing, everything is alright. But when i make changes to the function, the shell still has the old version of the function. Even if i make a new import. Does anyone know how to reload the actual versio...

How to programmatically exit pdb started in eval() or exec without showing output

In my python code I have this line: try: result = eval(command, self.globals, self.locals) except SyntaxError: exec(command, self.globals, self.locals) The command variable can be any string. Hence the python debugger pdb may be started in eval/exec and still be active when eval/exec is returning. What I want to do is make sur...