Cell Magics - not so magic

已查看 0 次
跳至第一个未读帖子

Claude Geller

未读,
2018年4月24日 01:10:452018/4/24
收件人 Anaconda - Public
Hi -

While trying to run certain commands for what is referenced as "cell magics" - I get errors.

This output demonstrates the issue I'm having:

Type "help", "copyright", "credits" or "license" for more information.
>>> %pwd
  File "<stdin>", line 1
    %pwd
    ^
SyntaxError: invalid syntax
>>> %ls
  File "<stdin>", line 1
    %ls
    ^
SyntaxError: invalid syntax
>>> %quickref
  File "<stdin>", line 1
    %quickref
    ^
SyntaxError: invalid syntax
>>>

It clearly doesn't like the "%" sign. i've tried a number of different commands that are supposed to be used in conjunction with a leading "%" sign - but none of them work.

Any help on this would be greatly appreciated.  THANKS!


Nehal J Wani

未读,
2018年4月24日 10:57:232018/4/24
收件人 anac...@continuum.io、trade...@gmail.com
Hi,

I think what you are looking for is the ipython prompt, and not the python prompt.

(ipython) thebox:~ nwani$ python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:14:23)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> %pwd
  File "<stdin>", line 1
    %pwd
    ^
SyntaxError: invalid syntax
>>>

(ipython) thebox:~ nwani$ ipython
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:14:23)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %pwd
Out[1]: '/Users/nwani'

In [2]:
Do you really want to exit ([y]/n)? y


Cheers!

Nehal J Wani

--
Community Discussion Forum for Anaconda
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

回复全部
回复作者
转发
0 个新帖子