Ondrej Certik | 19 Jul 21:44
Picon
Gravatar

confirm exit 0 the default?

Hi,

I find that I am always setting the confirm exit to 0 in my
.ipython/ipythonrc each time I install ipython.

What does the majority of users prefer? confirm exit 0 or 1 by default?

I found in docs/attic/ChangeLog

2002-11-02  Fernando Perez  <fperez <at> colorado.edu>

    * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
    default. Now that the default at the confirmation prompt is yes,
    it's not so intrusive. François' argument that ipython sessions
    tend to be complex enough not to lose them from an accidental C-d,
    is a valid one.

So I guess I won't convince you, but nevertheless I find it quite
annoying that ipython asks me -- do you really want to do what you
want to do?
For example Sage sessions can also be very valuable, but it doesn't
ask you if you really want to exit.

Ondrej
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Dick Moores | 18 Jul 14:35

Seems to be a bug in the verbose setting

I'm trying out   xmode Verbose   in my ipythonrc.ini .  I think I see a bug.

I have a module with a bunch of functions in it. I have IPython 
import all of these when it starts. One is asin_deg().

=================================================
In [2]: asin_deg(2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

E:\Python25\Scripts\<ipython console> in <module>()

E:\Python25\lib\site-packages\mine\mycalc.pyc in asin_deg(a=2, c=1)
      38     """
      39     from math import asin, degrees
---> 40     return degrees(asin(a*1.0/c))
         global Setting = undefined
         global sig_digits = undefined
         global to = undefined
         global will = undefined
         global set = undefined
         global it = undefined
      41
      42 def cos_deg(n):

ValueError: math domain error
===================================================

Of course, the  'ValueError: math domain error' is correct.  For 
asin_deg(x),  -1 < x < 1 must hold.
(Continue reading)

Ryan Krauss | 17 Jul 20:52
Picon

Eclipse, Pydev, and IPython

I ran acrossed a couple of threads about IPython and Ecplise via
PyDev, but don't see any resolution.  I am curious if Ecplise can
easily be made to use IPython instead of python when it runs a script.
 As I try and force python on more students, the dos prompt looking
IPython and having to cd to the correct directory still frightens
some.  Eclipse has a nice run button that makes it feel IDE-ish.  But
if I plot something and don't close the windows and then run the
script again, it seems like it spawns a new python thread and creates
more windows.  This is what I would expect from not using IPython
(which it currently isn't).

Has anyone out there easily configured eclispe and IPython to play together?

Alternatively, I was thinking of creating a little wxPython app that
is basically an IPython console with browse and edit buttons.  The
edit button would just make a system call that opens whatever file we
are currently running in a editor that has been specified in the
preferences or something.  Basically, can I make IPython, matplotlib,
and scipy feel enough like matlab that my students are less
intimitated by the forced switch.

Thanks,

Ryan
Dick Moores | 17 Jul 02:06
Picon

Difficulty in setting editor to TextPad

In my ipy_user_conf.py I have put this line:
ipy_editors.install_editor("C:\Program Files\TextPad 5\TextPad.exe 5")

I use -debug, and this is what it tells me:
'editor': '"C:\\Program Files\\TextPad 5\\textpad.exe"',

but

In [3]: ed versions.py
Editing... > C:\Program Files\TextPad 5\TextPad.exe 5
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
done. Executing edited code...
[snip]

It seems obvious that there still is a problem with the spaces in the
path, but I don't know what to do about them.
Help, please.

Dick Moores
Dick Moores | 16 Jul 23:02
Picon

Does IPython have a "restart"?

I  mean something equivalent to what you get when you do a Ctrl+F6 in IDLE:

>>> import math
>>> math.log(3)
1.0986122886681098
>>> =============================================== RESTART ===============================================
>>> math.log(3)

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    math.log(3)
NameError: name 'math' is not defined
>>>

Thanks,

Dick Moores
Dick Moores | 16 Jul 12:27
Picon

import question

Win XP Pro, Python 2.5.1, IPython 0.84

Here are the possibly relevant sections of my ipythonrc.ini so far:
<http://py77.python.pastebin.com/d13a168ea>.

With my ipythonrc.ini I want to cause this to happen:

import mpmath as p

How do I do it?

Thanks,

Dick Moores
Arnar Flatberg | 16 Jul 10:10
Picon

Ipython-matplotlib thread issue

Hi,

Interactive matplotlib shuts down on me.

I'm sorry, I do not have an example to reproduce the error. I don't even have a feeling when it happens. However, better to get it reported than be quiet,right?

I am using ipython from trunk (0.9.0.bzr.r1016 on python2.5, ubuntu 8.04 x86) and when working interactive with matplotlib (-pylab) I have (just a couple of times) recieved the warning:

Warning: Timeout for mainloop thread exceeded
switching to nonthreaded mode (until mainloop wakes up again)

After this warning, the matplotlib figures will no longer show or an empty figure pops up. Well, I am guessing my pylab thread got killed, right?

I have tried to reload matplolib and pylab, but that was obviously not a remedy. To me, the only solution was to restart ipython which is a major pain.
Is there perhaps some other way around?
Can I restart a pylab thread interactively ?

Thanks,
Arnar
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Gosu Carpenter | 16 Jul 01:13
Picon

Arbitrary shell command execution

I know ipython has several versions of basic shell commands - ls, cd, cp, mkdir, etc, but is there a way to run *any* command that is valid in your shell, including programs?
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
kevin beckford | 13 Jul 15:58
Picon

(no subject)

I am struggling with a hopefully simple problem in ipython .0.8.4.  Basically, I'm finding that I need to exit the interpreter when i add a new module to site-packages.  I've tried reload et al, but these do not seem to have the effect i want, ( that effect being that i can stay in the interpreter, adding new modules to the python path , and having them available to me ) 

for example:  I have a machine:

I run ipython and try:

import django 

This does not work because I've forgotten to actually install it.

I screen over to my admin screen, install the module and then in order to get ipython to re-read the modules, I'm forced to exit and enter ipython again.  Since I run ipython out of my .screenrc this is a bit inconvenient.  How can i avoid this?


--
Kevin Beckford
Technical Lead,
Lazyweb Construction Company,
http://lazyweb.ca
kevin <at> lazyweb.ca
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Dick Moores | 13 Jul 05:05
Picon

"0editor" ??

In [17]: y = 34

In [18]: y == 34
Out[18]: True
0editor
In [19]:

What is "0editor"?

Dick Moores
killian koepsell | 13 Jul 09:04
Picon

question about garbage collection

Hi,

I noted the following behavior in ipython: If you run the following
few lines in ipython, an object is created and destroyed:

In [1]: class C(object):
  ...:     def __del__(self):
  ...:         print 'deleting object...'
  ...:
  ...:

In [2]: obj = C()

In [3]: del obj
deleting object...

The same, of course, works if you run theses line within a script that
is called from ipython. If you don't delete the
object at the end of the script, it is available afterwards in
ipython. For some reason, the object destructor doesn't
seem to be called when the object is later deleted. It seems that even
after deleting the object, there is still some
reference to that object around somewhere. Is this the expected/wanted
behavior? Is it possible to force a complete
destruction of the object in order to free the used memory?

Thanks,
 Kilian

Gmane