Hello,
Detlev Offenbach wrote:
On Mittwoch, 24. September 2008, Darryl Wallace wrote:
Hello,
I think this has been asked many times before, but is there a way to
easily get the interactive CLI plotting working within the Eric4 shell?
I am trying to convince some coworkers that we can avoid purchasing
Matlab. Since the Eric4 IDE is so nice, all that's missing for me is the
plotting (more or less). I have the interactive plotting working from
those posted on the website for PyQwt CLI examples
(http://pyqwt.sourceforge.net/cli-examples.html) for the standard Python
console, but it appears as though environment variables and things I have
set up do not transfer to the ERIC shell.
You can set the environment for the script to debug in the start window. In
there you can ammend the environment or replace it. Another thing you might
try is to enable the console debugger (Debugger->General page or
Project-Debugger->Debugger Properties to set it on a per project base).
Detlev
I tried setting the environment with a script I have in my home folder
called ".pystartup.py" (attached). In Settings-> Preferences ->
Debugger -> General -> "Enviornment for Debug Client" I set replace
environment with this script. "/home/darryl/.pystartup.py"
The first test I did was I put print statements in the script to see if
they come up in the shell. So they aren't. I dunno, am I doing it wrong??
I've set this script to be my python environment under my bashrc script
and everything works fine there.
Any ideas??
Thanks,
darryl
#import IPython
#IPython.Shell.IPShell().mainloop(sys_exit=1)
# Set your PYTHONSTARTUP environment variable to $HOME/.pythonrc.py
#
# inspired by:
# http://opag.ca/wiki/OpagCode/OpagSnippets
print "IMPORTING"
# Import Numpy and SciPy
try:
import numpy as np
print "NumPy Imported"
import scipy as sp
sp.pkgload()
print "SciPy Imported"
except ImportError:
pass
# Import PyQt4.Qt and PyQt4.Qwt5; initialize an application.
# Note: hides the builtins hex and oct.
try:
from PyQt4.Qt import *
from PyQt4.Qwt5 import *
from PyQt4.Qwt5.qplt import *
application = QApplication([])
except ImportError:
application = None
# Setup readline and history saving
from atexit import register
from os import path
import readline
import rlcompleter
# Set up a tab for completion; use a single space to indent Python code.
readline.parse_and_bind('tab: complete')
history = path.expanduser('.pyhistory')
readline.set_history_length(1000)
# Read the history of the previous session, if it exists.
if path.exists(history):
readline.read_history_file(history)
# Set up history saving on exit.
def save(history=history, readline=readline, application=application):
readline.write_history_file(history)
register(save)
# Clean up the global name space; save, history, readline, and application
# will continue to exist, since del decrements the reference count by one.
del register, path, readline, rlcompleter, history, save, application
# Local Variables: ***
# mode: python ***
# End: ***
_______________________________________________
Eric mailing list
[email protected]
http://www.riverbankcomputing.com/mailman/listinfo/eric