Embedded Python as in EXCEL
ThreeBlindQuarks via Tutor <[email protected]> Fri, 26 Jun 2026 00:46:14 +0000
| Newsgroups | gmane.comp.python.tutor |
|---|---|
| Message-ID | <lhOrG8-ngovup5AMhqKgu0_5MXgjAMJ_fygrwGy30foCHzh338zL-dqr2ZgoA0ybE1cHRdvxnwJzPQM6xa7V8RuMkbpCQeYX5v1ACt8YXys=@proton.me> |
I recently noticed that you can now include Python code in cells in an EXCEL spreadsheet and wondered if anyone had tried it. For comparison, I have used Python code in other embedded scenarios such as within several document formats where you can have text that has multiple embedded calls to process snippets of Python and show the results embedded in the text in various ways. Examples include Jupyter Notebooks, Markdown and the newer Quarto. In some cases, you can run each snippet of code within a box of sorts and have the results shown after or instead of showing the code, including often graphics, and sometimes you can place the computation inline in the text and have it replaced by the result. And, I have written code where I use other languages like R this way and even both at once cooperating intimately. In these cases, where Python shares a partial environment with some other system including access to a sort of shared memory, there are special ways within Python to access parts of that memory so changes made are also seen by the partner in their way. With EXCEL, if interested, you can see some details at the URL below. I am NOT suggesting you use EXCEL, just sharing in case you wonder how the two cooperate. https://support.microsoft.com/en-us/excel/python/introduction-to-python-in-excel I note an interesting perspective in EXCEL that is a bit different. It is a 2-D approach of cells as compared to the earlier examples that are 1-D. So they had to choose a way to evaluate cell after cell. If an earlier cell created and initialized a variable, it will only be available to cells evaluated later or you have errors. It seems the norm is to evaluate cells from left to right for as long as a row is, then the next row on down. Constant recalculation can be very expensive, so there are ways to control it. And note, quite a bit of the purpose of using Python in EXCEL may well be parts that are add-on modules like pandas to support data.frames. And there are special functions to access data on the sheet and so on. Not quite beginner Python. One more reason for some to learn Python, though, if you want to do things not available in the standard EXCEL function tree! LOL! Drop me a line if you have tried it or find it interesting at [email protected] unless, of course, your message would be of interest to others. Given the many places Python exists, it is suggested people asking questions should mention where and how they are using python. In this case, the embedded python seems to be related to the anaconda distribution and may often lag behind ... Sent with [Proton Mail](https://proton.me/mail/home) secure email. _______________________________________________ Tutor maillist - To unsubscribe send an email to [email protected] To unsubscribe or change subscription options: %(web_page_url)slistinfo/%(_internal_name)s