On Monday, November 14, 2016 at 12:40:53 PM UTC, Rouven Dreimann wrote:
>
> Hello Everybody,
>
> I want to use Sage with PyCharm, but I got some problems. First of all:
> I start sage-shell with:
>
> ```sh
> sage -sh
>
> (sage-sh) rdreimann@C3XZ562:~$ ./pycharm-community-2016.2.3/bin/pycharm.sh
> ```
>
> Now my problem:
> Most of my code works fine then, but when I do something like this
>
> ```python
> Zx.<x> = ZZ[]
> ```
>
> I got an error:
>
> ```
> Zx.<x> = ZZ[];
> ^
> SyntaxError: invalid syntax
> ```
>
> When I use a worksheet in my "normal" notbook() everything's fine...
>
Sage extends Python syntax by using a preparser; e.g.
sage: preparse('Zx.<x> = ZZ[]')
"Zx = ZZ['x']; (x,) = Zx._first_ngens(1)"
and so everything at Sage prompt is automatically preparsed.
I don't know whether you can force this upon PyCharm,
but you can still use everything you need using Python syntax.
Note that the Sage library is written this way (no preparser),
so there are plenty of examples there;
also e.g. your example would be just
import sage.all
from sage.all import ZZ
Zx = ZZ['x']
(x,) = Zx._first_ngens(1)
# or just (x,)=Zx.gens()
Any ideas, how I can have all the sage features in my pycharm?
>
> Thanks
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.