Ho, I had not seen that you had posted on ask.sagemath.org <https://ask.sagemath.org/question/39742/use-pycharm-to-edit-and-run-sage-scripts/?answer=40220#post-id-40220>! I don't have time to try right now, but I will later - I think it really helps a lot!
Re the question of IDE/editor: You're right I messed my wording up a bit, sorry. But I purposefully specified 'IDE' in the initial question, but when I found out that probably was not going to work (as I then thought) I put my hopes on making an editor able to execute Sage from within the editor - so make it a tiny bit integrated but not really. Thanks for writing it down clearly! I find it very interesting to hear that you do not think PyCharm useful for writing in Python - but I use PyCharm nearly every day just as quite a lot of people, hence it would be very convenient if I could write sage in PyCharm - even without syntax highlighting or autocomplete. On Tuesday, December 19, 2017 at 12:28:52 PM UTC+1, Erik Bray wrote: > > On Tue, Dec 19, 2017 at 7:30 AM, PHPirate <holland...@gmail.com > <javascript:>> wrote: > > Thanks for the replies, so I would be very interested to run vim or > emacs on > > Windows (although I have never heard of any windows user doing so) but > since > > you both run a different OS you may not know how to set this up on > Windows? > > I'll try in any case later on, I think I should open a separate topic > for > > that I guess? > > > > For now, I found some tips at https://wiki.sagemath.org/Tips about > usage > > with vim, and a couple of vim plugins like > > https://github.com/petRUShka/vim-sage but no complete installation > guide. Is > > there one? If not, if I manage to get it work I will write one myself > then. > > I really hope I will manage to run Sage scripts from within vim, as the > wiki > > hints is possible! > > > > In any case, conclusion for this topic: don't use PyCharm, try vim (or > if > > you want, emacs or atom or whatever) instead. > > > > Let me quote Martin Vahi... > > "As a side note I say that I've noticed that software developers, me > myself > > included, are usually not as good at math as they _should_ and pure > > mathematicians tend to be at software development not as good as they > could. > > That seems to explain a lot of things in this world. :-D" > > I should maybe help clarify for you--if all you care about is > *editing* files you don't need a full IDE, you just need an editor. > All an editor does is edit files (though most advanced editors can do > much more, with the proper extensions, such as run code or arbitrary > shell commands). An IDE contains an editor as a central component, > but it also has other development tools built into it like a compiler > front-end, front-ends for build tools, debuggers, etc. (hence > "integrated") rather than running an editor and those other tools as > separate components. > > I wouldn't say one way of working is better or worse than another--it > depends in part on personal preferences and how you think, as well as > the type of project. I'd be surprised if any Sage developer uses a > full IDE for anything except maybe if they happen to like their IDE's > editor. This is in part because Sage has so many idiosyncrasies that > a traditional IDE probably won't work too well with it without > significant tweaking as you've found with trying to use it with > PyCharm. > > I've personally never used an IDE for Python at all and I don't find > it that useful, but do use an IDE (Eclipse) when working on Java, and > Visual Studio when working on Windows-specific projects. > > If you like PyCharm for its editor you can certainly get it working (I > provided instructions on the ask.sage question) to run code as well. > It should be straightforward to set up PyCharm to parse .sage scripts > through the sage-parser before running them with the plain Python > interpreter too. But you might also be just as well off finding a > stand-alone editor that you like. > > > On Monday, December 18, 2017 at 10:25:14 PM UTC+1, Dima Pasechnik wrote: > >> > >> > >> > >> On Monday, December 18, 2017 at 8:20:18 PM UTC, David Roe wrote: > >>> > >>> > >>> > >>> On Mon, Dec 18, 2017 at 8:55 AM, PHPirate <holland...@gmail.com> > wrote: > >>>> > >>>> Thanks, that sounds a bit too difficult for me though so I'll just > stick > >>>> to writing in PyCharm and try to execute my Sage files via the Sage > shell. > >>>> > >>>> But out of curiosity, am I the only one wanting to write scripts in > >>>> Sage? Or are there other people using editors in the same way? > >>> > >>> > >>> I think many people write scripts for Sage, though much of that > >>> development isn't happening on Windows. Personally, I use emacs on OS > X. > >> > >> > >> I use vim on Linux (as well as, if needed, on OSX and on FreeBSD). > Surely > >> it does syntax highlighting for Python/Cython > >> and with a small effort for Sage (as it's basically Python, > language-wise) > >> too... > >> > >> I know people using atom for the same purpose (and yes, emacs for > sure). > >> > >> Vim and emacs run, natively, on Windows. IMHO Notepad is the last > >> resort... > >> > >>> > >>> David > >>> > >>>> > >>>> > >>>> On Monday, December 18, 2017 at 5:42:50 PM UTC+1, Erik Bray wrote: > >>>>> > >>>>> On Mon, Dec 18, 2017 at 5:37 PM, PHPirate <holland...@gmail.com> > wrote: > >>>>> > Hm, it is at least worth a try (just saw your message on GH) Okay > I > >>>>> > can > >>>>> > understand if Sage has no syntax highlighting in any IDE on > Windows, > >>>>> > but as > >>>>> > the situation is now for me, is that there is no IDE in which you > can > >>>>> > type > >>>>> > Sage and then hit 'run' and then get Sage output. Now I think I > could > >>>>> > write > >>>>> > Sage in Notepad and then execute a Sage file via the Sage shell > but > >>>>> > I'm > >>>>> > looking to shortcut that a bit (my expectations are quite lower > now I > >>>>> > know > >>>>> > that Sage doesn't have a standard editor which everyone uses). > >>>>> > > >>>>> > But is it a bad idea to write Sage scripts? Did I misunderstand > >>>>> > something, > >>>>> > and should I use the console only? > >>>>> > >>>>> It's not at all a bad idea; it's just that if you want correct > syntax > >>>>> highlighting for it you'll have to use an editor for which there is > >>>>> syntax highlighting support for Sage, or add it yourself to your > >>>>> editor of choice. Certainly there's no reason to use notepad > >>>>> regardless. It's just that different editors have different means > of > >>>>> providing syntax highlighting for new languages (where Sage's syntax > >>>>> is just a small superset over pure Python syntax). > >>>>> > >>>>> More importantly, the default Python interpreter also isn't going to > >>>>> know how to execute a Sage script, though it seems that in PyCharm > >>>>> it's probably possible to configure the necessary options to > pre-load > >>>>> the Sage syntax parser and then pass it a .sage script, but I > haven't > >>>>> tried it yet. > >>>>> > >>>>> > On Monday, December 18, 2017 at 2:06:09 PM UTC+1, Erik Bray wrote: > >>>>> >> > >>>>> >> That sounds a bit bogus to me. I've never used PyCharm before > and > >>>>> >> don't > >>>>> >> know how it works, but I suspect it could be made to work with > >>>>> >> Cygwin's > >>>>> >> Python. It's pretty low-priority for me though. I don't see how > >>>>> >> using > >>>>> >> PyCharm to edit sage source code would be useful--it won't even > do > >>>>> >> syntax > >>>>> >> highlighting properly, unless I'm missing something. > >>>>> >> > >>>>> >> On Saturday, December 16, 2017 at 2:01:08 PM UTC+1, Dima > Pasechnik > >>>>> >> wrote: > >>>>> >>> > >>>>> >>> I've already expalined here > >>>>> >>> https://github.com/sagemath/sage-windows/issues/12 that PyCharm > >>>>> >>> doesn't > >>>>> >>> support Cygwin Python, > >>>>> >>> and thus it's not going to be trivial to fix. The reason that we > >>>>> >>> must use > >>>>> >>> Cygwin Python is that a number of essential Sage components > (i.e. > >>>>> >>> Python > >>>>> >>> extensions you need) e.g. GAP, won't work natively on Windows, > as > >>>>> >>> they use > >>>>> >>> fork() and other Unix/Posix specific system functions. > >>>>> >>> > >>>>> >>> On Saturday, December 16, 2017 at 12:19:56 PM UTC, PHPirate > wrote: > >>>>> >>>> > >>>>> >>>> Thanks, it sounds reasonable. But do you mean the Jupyter > notebook > >>>>> >>>> included with Sage, which you can start with > >>>>> >>>> sage --notebook ipython > >>>>> >>>> from the Sage shell? I do not like notebooks such as this one > and > >>>>> >>>> Mathematica because they do not go well with a VCS. Is it then > >>>>> >>>> possible to > >>>>> >>>> use this Jupyter to edit and run Sage files saved in a better > way, > >>>>> >>>> like > >>>>> >>>> python files? > >>>>> > > >>>>> > -- > >>>>> > You received this message because you are subscribed to the Google > >>>>> > Groups > >>>>> > "sage-devel" group. > >>>>> > To unsubscribe from this group and stop receiving emails from it, > >>>>> > send an > >>>>> > email to sage-devel+...@googlegroups.com. > >>>>> > To post to this group, send email to sage-...@googlegroups.com. > >>>>> > Visit this group at https://groups.google.com/group/sage-devel. > >>>>> > For more options, visit https://groups.google.com/d/optout. > >>>> > >>>> -- > >>>> You received this message because you are subscribed to the Google > >>>> Groups "sage-devel" group. > >>>> To unsubscribe from this group and stop receiving emails from it, > send > >>>> an email to sage-devel+...@googlegroups.com. > >>>> To post to this group, send email to sage-...@googlegroups.com. > >>>> Visit this group at https://groups.google.com/group/sage-devel. > >>>> For more options, visit https://groups.google.com/d/optout. > >>> > >>> > > -- > > You received this message because you are subscribed to the Google > Groups > > "sage-devel" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to sage-devel+...@googlegroups.com <javascript:>. > > To post to this group, send email to sage-...@googlegroups.com > <javascript:>. > > Visit this group at https://groups.google.com/group/sage-devel. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.