Discussion:
[spyder] The '%clear' command is not implemented correctly in Spyder's interpreter
Srinivasan Rajaraman
2014-12-15 00:41:47 UTC
Permalink
Hi,

I am new to using Spyder. I am now using Spyder 2.3.1 version. When I
type "scientific" in Spyder, it says the following:

*Within Spyder, this interpreter also provides:*
* * special commands (e.g. %ls, %pwd, %clear)*
* * system commands, i.e. all commands starting with '!' are
subprocessed*
* (e.g. !dir on Windows or !ls on Linux, and so on)*

However, %clear command does not work correctly. I get the following:

*>>> %clear*
*Traceback (most recent call last):*
* File "<stdin>", line 1, in <module>*
* File
"C:\Users\Sripa\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 648, in evalsc*
* raise NotImplementedError("Unsupported command: '%s'" % command)*
*NotImplementedError: Unsupported command: 'clear'*

Could somebody tell me if my Spyder implementation in incorrect? If not,
what is missing?

Regards,
Srini
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Adrian Klaver
2014-12-15 00:55:59 UTC
Permalink
Post by Srinivasan Rajaraman
Hi,
I am new to using Spyder. I am now using Spyder 2.3.1 version. When I
/*Within Spyder, this interpreter also provides:*/
/* * special commands (e.g. %ls, %pwd, %clear)*/
/* * system commands, i.e. all commands starting with '!' are
subprocessed*/
/* (e.g. !dir on Windows or !ls on Linux, and so on)*/
/
/
/*>>> %clear*/
/*Traceback (most recent call last):*/
/* File "<stdin>", line 1, in <module>*/
/* File
"C:\Users\Sripa\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
line 648, in evalsc*/
/* raise NotImplementedError("Unsupported command: '%s'" % command)*/
/*NotImplementedError: Unsupported command: 'clear'*/
/
/
Could somebody tell me if my Spyder implementation in incorrect? If
not, what is missing?
Are you in the Python console or the Ipython console?
Post by Srinivasan Rajaraman
Regards,
Srini
--
Adrian Klaver
***@aklaver.com
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Srinivasan Rajaraman
2014-12-15 21:47:11 UTC
Permalink
I am in the Python console.
Srini
Post by Srinivasan Rajaraman
Post by Srinivasan Rajaraman
Hi,
I am new to using Spyder. I am now using Spyder 2.3.1 version. When I
/*Within Spyder, this interpreter also provides:*/
/* * special commands (e.g. %ls, %pwd, %clear)*/
/* * system commands, i.e. all commands starting with '!' are
subprocessed*/
/* (e.g. !dir on Windows or !ls on Linux, and so on)*/
/
/
/*>>> %clear*/
/*Traceback (most recent call last):*/
/* File "<stdin>", line 1, in <module>*/
/* File
"C:\Users\Sripa\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
Post by Srinivasan Rajaraman
line 648, in evalsc*/
/* raise NotImplementedError("Unsupported command: '%s'" % command)*/
/*NotImplementedError: Unsupported command: 'clear'*/
/
/
Could somebody tell me if my Spyder implementation in incorrect? If
not, what is missing?
Are you in the Python console or the Ipython console?
Post by Srinivasan Rajaraman
Regards,
Srini
--
Adrian Klaver
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Adrian Klaver
2014-12-15 23:43:02 UTC
Permalink
Post by Srinivasan Rajaraman
I am in the Python console.
Aah, I figured it out. Spyder uses the scientific_startup.py script in
the console STARTUP script to try to emulate some of the IPython
commands. The %clear 'magic' provided does not work the same as the
Post by Srinivasan Rajaraman
Post by Srinivasan Rajaraman
s = 'str'
%clear s
s
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 's' is not defined

clear in this case works on variables versus just clearing the screen as
it does in IPython.

If it where me I would just stick to the IPython console.
Post by Srinivasan Rajaraman
Srini
Post by Srinivasan Rajaraman
Hi,
I am new to using Spyder. I am now using Spyder 2.3.1 version.
When I
Post by Srinivasan Rajaraman
/*Within Spyder, this interpreter also provides:*/
/* * special commands (e.g. %ls, %pwd, %clear)*/
/* * system commands, i.e. all commands starting with '!' are
subprocessed*/
/* (e.g. !dir on Windows or !ls on Linux, and so on)*/
/
/
However, %clear command does not work correctly. I get the
/*>>> %clear*/
/*Traceback (most recent call last):*/
/* File "<stdin>", line 1, in <module>*/
/* File
"C:\Users\Sripa\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
Post by Srinivasan Rajaraman
line 648, in evalsc*/
/* raise NotImplementedError("Unsupported command: '%s'" %
command)*/
Post by Srinivasan Rajaraman
/*NotImplementedError: Unsupported command: 'clear'*/
/
/
Could somebody tell me if my Spyder implementation in
incorrect? If
Post by Srinivasan Rajaraman
not, what is missing?
Are you in the Python console or the Ipython console?
Post by Srinivasan Rajaraman
Regards,
Srini
--
Adrian Klaver
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
--
Adrian Klaver
***@aklaver.com
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Srinivasan Rajaraman
2014-12-15 23:51:08 UTC
Permalink
Thank you Adrian. I am switching from MATLAB to Python, so I like Spyder
more than IPython console.

Srini
Post by Adrian Klaver
Post by Srinivasan Rajaraman
I am in the Python console.
Aah, I figured it out. Spyder uses the scientific_startup.py script in
the console STARTUP script to try to emulate some of the IPython
commands. The %clear 'magic' provided does not work the same as the
Post by Srinivasan Rajaraman
Post by Srinivasan Rajaraman
s = 'str'
%clear s
s
File "<stdin>", line 1, in <module>
NameError: name 's' is not defined
clear in this case works on variables versus just clearing the screen as
it does in IPython.
If it where me I would just stick to the IPython console.
Post by Srinivasan Rajaraman
Srini
Post by Srinivasan Rajaraman
Hi,
I am new to using Spyder. I am now using Spyder 2.3.1 version.
When I
Post by Srinivasan Rajaraman
/*Within Spyder, this interpreter also provides:*/
/* * special commands (e.g. %ls, %pwd, %clear)*/
/* * system commands, i.e. all commands starting with '!' are
subprocessed*/
/* (e.g. !dir on Windows or !ls on Linux, and so on)*/
/
/
However, %clear command does not work correctly. I get the
/*>>> %clear*/
/*Traceback (most recent call last):*/
/* File "<stdin>", line 1, in <module>*/
/* File
"C:\Users\Sripa\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",
Post by Srinivasan Rajaraman
Post by Srinivasan Rajaraman
line 648, in evalsc*/
/* raise NotImplementedError("Unsupported command: '%s'" %
command)*/
Post by Srinivasan Rajaraman
/*NotImplementedError: Unsupported command: 'clear'*/
/
/
Could somebody tell me if my Spyder implementation in
incorrect? If
Post by Srinivasan Rajaraman
not, what is missing?
Are you in the Python console or the Ipython console?
Post by Srinivasan Rajaraman
Regards,
Srini
--
Adrian Klaver
--
You received this message because you are subscribed to the Google
Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send
<javascript:>
Post by Srinivasan Rajaraman
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
--
Adrian Klaver
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Adrian Klaver
2014-12-16 00:01:17 UTC
Permalink
Post by Srinivasan Rajaraman
Thank you Adrian. I am switching from MATLAB to Python, so I like
Spyder more than IPython console.
I am not following. If you use Spyder I presume you will be running code
in it. If you do that, you will be running the code in a console. If
IPython is installed on your system(which I believe it is via Anaconda)
then it will be one of the consoles available. I think you will find
running the code in IPython will be a better experience.
Post by Srinivasan Rajaraman
Srini
--
Adrian Klaver
***@aklaver.com
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Adrian Klaver
2014-12-16 23:43:57 UTC
Permalink
Post by Adrian Klaver
Post by Srinivasan Rajaraman
Thank you Adrian. I am switching from MATLAB to Python, so I like
Spyder more than IPython console.
I am not following. If you use Spyder I presume you will be running code
in it. If you do that, you will be running the code in a console. If
IPython is installed on your system(which I believe it is via Anaconda)
then it will be one of the consoles available. I think you will find
running the code in IPython will be a better experience.
It depends on how you run code. IPython is great if you always run code
in the same interpreter, or run interactive commands.
Personally I prefer writing scripts (event for a few lines) and running
them from a fresh interpreter. I've been bitten too much by old
variables (especially in matlab), so I prefer to know exactly what has
been run. In this case IPython gives no benefit while python is way
I figured that is what Run again last file(Ctrl+F6) is for:) At any rate
the OP was asking about interactive commands, so I went on the
assumption that was what they wanted to use.
faster to start up.
Joseph
--
Adrian Klaver
***@aklaver.com
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.
Loading...