Hi, I am wondering a good way to follow if i would like to redefine the members of a previous defined class in ipython.
say :
I have defined a class intro like below, and later i want to redefine part of the function definition _print_api. Any way to do that without retyping it .
class intro(object):
def _print_api(self,obj):
...
Hello,
I have written a python script with methods in it. Now I want to use methods from that script in ipython. How do I import it for use in ipython?
Cheers
...
Tab completion on IPython seems not to be working. For example,
import numpy
numpy.<tab>
simply adds a tab.
import numpy
num<tab>
just adds a tab, too. Could you please suggest some possible causes for this problem? I am running Windows 7 and Python 2.6.5.
...
I'm doing some research with an interactive shell and using a Django app (shell_plus) for storing data and browsing it using the convenient admin.
Occasionally I add or change some of the app models, and run a syncdb (or South migration when changing a model). The changes to the models don't take effect in my interactive session even if...
I want to be able to bring up an interactive python terminal from my python application. Some, but not all, variables in my program needs to be exposed to the interpreter.
Currently I use a sub-classed and modified QPlainTextEdit and route all "commands" there to eval or exec, and keep track of a separate namespace in a dict. However th...
Does anyone know of a python IDE that has iPython as the interpreter?
Using the standard interpreter just drives me nuts, as I've just grown to love using iPython and all the features it provides. To be honest, I'd rather code with a simple text editor + ipython than an IDE, but I love being able to set breakpoints with a click of a ...
While developing a largeish project (split in several files and folders) in Python with IPython, I run into the trouble of cached imported modules.
The problem is that instructions import module only reads the module once, even if that module has changed! So each time I change something in my package, I have to quit and restart IPython....
Ipython has a plugin called autoreload that will presumably reload all your modules after every command, so you can change the source and not have to quit the shell and reenter all your commands. See http://dsnra.jpl.nasa.gov/software/Python/tips-ipython.html for example.
However, this seems flaky at best when using it with Django, e....
I tried
echo "print 'hello'" | ipython
Which runs the command but ipython immediately exits afterwards.
Any ideas? Thanks!
Edit:
I actually need to pass the command into the interactive Django shell, e.g.:
echo "print 'hello'" | python manage.py shell
so the -i switch gimel suggested doesn't seem to work (the shell still exits af...
Hi all,
I encountered a problem with the scope variables have when IPython is invoked at the end of a python script.
All functions I call in the script itself can modify variables, which will subsequently be used by other functions.
If I call the same functions in ipython, the scripted ones can access the changed variables but variables...
ipython's %his command outputs recent commands entered by the user. Is it possible to search within these commands? Something like this:
[c for c in %history if c.startswith('plot')]
EDIT I am not looking for a way to rerun a command, but to locate it in the history list. Of course, sometimes I will want to rerun a command after locat...
I've just started playing around with IPython, and it's got some pretty cool features. I especially like that it "remembers" input from previous shell sessions. I am having some trouble, however, with the tab completion.
Here's an example of my console:
In [5]: a.__class__.python(58387,0x7fff70630c20)
malloc: *** error for object 0x10...
I'm embedding iPython shell in a Django script (with development server, e.g. runserver at localhost) like this:
...
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed()
ipshell()
...
which gives me interactive shell at the desired place. Now, if modify the source code, Django automatically reloads, probably without correct...
I've looked but didn't find previous questions specific enough, so sorry if this is repeated.
Goal: GUI to continuously update figure with different matrix data plotted by pylab's pcolor such that there is a running animation. But user should be able to play, pause, stop animation by Tkinter widget buttons.
Before I get an answer for ma...
Hi,
I'm doing a lot of development in IPython where
In[3]: from mystuff import MyObject
and then I make lots of changes in mystuff.py. In order to update the namespace, I have to do
In[4]: reload(mystuff)
In[5]: from mystuff import MyObject
Is there a better way to do this? Note that I cannot import MyObject by referencing mystuff...
I am on MacOSX Snow Leopard and I'm using python 2.6.5 installed with macports. I'm inside a virtualenv.
I can't run python manage.py shell after installing IPython but I can run IPython standalone.
I figured out that the following line is what causes the issue:
(status, result) = commands.getstatusoutput("otool -L %s | grep libedit" %...
My use case is I want to initialize some functions in a file and then start up ipython with those functions defined. Is there any way to do something like ipython --run_script=myscript.py?
...
So, I'm a huge IPython fan, though I'm sure I don't use nearly all the power it has (mainly tab completion and ? for introspection, though I also use %ed a fair amount).
However, I want to really start working with Python3k, and as this thread states, I'll need a Snickers to tide me over til IPython is ported.
So what are my options fo...
if I run this...
import ipdb
print 'a'
ipdb.set_trace()
print 'b'
and then type 'q' to quit I get a 300 line error message.
python 2.5.4 on windows.
> d:\python25\scripts\a.py(4)<module>()
2 print 'a'
3 ipdb.set_trace()
----> 4 print 'b'
ipdb> q
ERROR: An unexpected error occurred while tokenizing input
The following tracebac...
I'd like to run a new command from IPython configuration and capture its output. Basically, I'd like to access the equivalent of !command via normal functions. I know I can just use subprocess, but since IPython already provides this functionality, I guess there must be a properly made wrapper included somewhere in the API.
...