21 ms·
Microsoft is bringing Python to Excel
- jk3000 3y agohttps://www.xlwings.org/ https://www.xlwings.org/
- TalhaKhan99 3y agoIs this feature enables because of Webassembly? Considering that we assembly let’s people run python code natively in the browser?
- bigfudge 3y agoIf this is true then it will be amazing and very widely adopted. Pandas in Excel would be cool. Fingers crossed.
- andsoitis 3y ago> If this is true https://techcommunity.microsoft.com/t5/excel-blog/announcing-python-in-excel-combining-the-power-of-python-and-the/ba-p/3893439 https://techcommunity.microsoft.com/t5/excel-blog/announcing...
- qntty 3y agoI'd be happy if I could just represent integers with more than 15 digits without rounding (e.g. 64-bit primary keys)
- diffeomorphism 3y agoWhy? Libreoffice calc had python for years now and nobody cared: https://help.libreoffice.org/6.3/en-US/text/sbasic/python/python_programming.html https://help.libreoffice.org/6.3/en-US/text/sbasic/python/py...
- alexriddle 3y agoFor someone working outside IT but who has coding skills, it's great. My previous work computers have been tightly controlled by IT and installing libreoffice on them wouldn't have been permitted.
- codetrotter 3y agoBecause the world runs Excel, not LibreOffice Calc.
- pasc1878 3y agoBeacuse anyone with a budget had Excel already - and had to use Excel to be able to use other peoples' spreadsheets. LibreOffice is not bug compatible with Excel. Look what Excel had tro do to replace Lotus 1-2-3. Including making 1900 a leap year beacuse Lotus had the error.
- bafe 3y agoI love free software as much as anyone, but when I'm forced to use a spreadsheet I'm glad we get office at work. The UI/UX of LibreOffice could use a lot of improvements
- xxs 3y ago> it will be amazing and very widely adopted. The calculations in the cloud?
- narcraft 3y agoWhy would the vast majority of Excel users even notice or care about this?
- kbelder 3y agoThe ones that use python would. It being cloud-based makes it a pretty useless feature for anything that I was using Python & Pandas for. If it was on the client side, I'd be rolling it out to users the moment it was available.
- pasc1878 3y agoBecause they have financial data on it and putting financial information outside computers your company controls is a massive risk.
- debitcredit 3y agoWe're working on this at op (https://opapp.io https://opapp.io). Pandas in a spreadsheet, just not an excel spreadsheet if you're able to jump ship.
- skolos 3y agoHere you go: https://blog.adaptiverisk.com/post/2023-08-22-dataslicer/ https://blog.adaptiverisk.com/post/2023-08-22-dataslicer/ Calculations are local, not in the cloud.
- hathym 3y ago》Python calculations run in Microsoft’s Cloud No thanks!
- cardamomo 3y agoThat caught my attention too! I'm curious why they would choose this model.
- brokencode 3y agoProbably because Excel runs in a web browser nowadays and they want to avoid creating a separate way of running Python locally for a locally installed copy of Excel. Maybe they will in the future, but it makes sense to start with the approach that will work in both web and local installs.
- tigeroil 3y agoLooking at what they're doing with Outlook I'd bet money that they intend to replace the desktop version of Excel with the web version sooner or later.
- Spivak 3y agoThat's got to be the death-knell for Excel. It might be better in every conceivable way but going web-only only makes Sheets look more attractive to the people doing the buying. And you can run JS in your Sheets right now.
- walthamstow 3y agoI agree but expect that Excel will be the very last app of the suite that they make web-only. Excel heads like my wife absolutely hate the web version.
- kaashif 3y agoA lot of people in finance are Excel heads and hate the web version. And they have a lot of money to throw around, surely Microsoft cares about them. I really don't see them killing the desktop version.
- cumshitpiss 3y agogame changers for the competitive scene, looking forward to MAKRO's commentary
- CodeCompost 3y agoWait, didn't they already do this? I'm pretty sure I downloaded an official add-on for this a few years ago.
- tecleandor 3y agoAFAIK, as a third party add-on: https://www.pyxll.com/docs/introduction.html https://www.pyxll.com/docs/introduction.html
- nailer 3y agoThere was a YC company that did it, maybe a decade ago. I bet someone will remember.
- ayhanfuat 3y agoDataNitro! I knew very little about programming and was trying to create examination schedules for the faculty I was working at. I managed to convince the dean to buy a license and it pretty much changed my life (granted it was mostly Python that changed it but DataNitro made it even more accessible it to me back then).
- fzumstein 3y agoDataNitro was my inspiration for the Open Source version of xlwings back in 2014. They have been out of business for many years though.
- siva7 3y agoSoon Python will rule it all as the most widely adopted language
- pritambaral 3y agoUntil Excel can run Python locally, I doubt it.
- hyperpl 3y agoMy main dependence on Excel is being able to interact with pivot tables. I also have some VBA macros to help with formatting which I would welcome to be in python - alas it looks like what they're bringing is for the cloud only? I haven't found any free, open source solutions around this including any for Jupyter notebooks (my preferred medium).
- xcombelle 3y agopython pandas has pivot tables https://pandas.pydata.org/docs/reference/api/pandas.pivot_table.html https://pandas.pydata.org/docs/reference/api/pandas.pivot_ta... I don't know if it fits your needs
- pasc1878 3y agoSo you can click and drag the columns around in the pivot table to get a better view?
- reportgunner 3y agoimho using pandas for pivot tables is like using a cannon to shoot sparrows
- garyclarke27 3y agoWhy does Excel need to run Python calculations in the Cloud? I think I'll stick to VBA. Javascript in Excel would be nice. Even better would be native SQL.
- DwnVoteHoneyPot 3y agoExcel has javascript… Google “Officescript in Excel”. Also, https://learn.microsoft.com/en-us/office/dev/scripts/resources/samples/excel-samples https://learn.microsoft.com/en-us/office/dev/scripts/resourc...
- pipo234 3y agoMaybe this is not so much about bringing Python to Excel, more about bringing Excel to Python. But only if you do it the way Microsoft wants you to. As with BASIC morphing into VisualBasic and VBA you lure (beginning) python programmers into Excel. Ultimately those developers will understand and appreciate less and less of vanilla python REPL, jupyter, scripts, etc. And... Welcome to Microsoft's world.
- Qem 3y agoA Microsoft classic: https://en.m.wikipedia.org/wiki/Embrace,_extend,_and_extinguish https://en.m.wikipedia.org/wiki/Embrace,_extend,_and_extingu...
- giaour 3y ago> Javascript in Excel would be nice. JS has been one of the supported add-in languages for a while[0], but that's not quite the same thing as the new python offering (which sounds more like jupyter within excel). Since excel is often (mostly?) used for working with financial calculations, I for one am glad they went with python for this feature instead of a language that insists that an IEEE 754 double is the only kind of number anybody actually needs
- extraduder_ire 3y agoJS has BigInt now, and it almost works like you'd expect. Need to put 'n' after all of your numbers though.
- cableshaft 3y agoI wish it wasn't solely powered only by Microsoft Cloud and could support python running locally, but regardless I think this will still be huge and single-handedly modernizes Excel by a large margin. This alone could eliminate the need for websites that just want this sort of data. I can think of a past project at a previous job I did building an analytics website used only by a handful of people internally that could have been just as well served with something like this, had it existed at the time.
- ZeroCool2u 3y agoOh the cloud part is going to be a huge deal breaker in so many industries. This will automatically be blocked by default at my work place for certain.
- layer8 3y agoIt sort of makes sense to limit it to the cloud, because making Python an integral part of the Excel file format would reduce its portability and introduce all sorts of compatibility headaches going forward.
- felixgallo 3y agoExcel already has versioned file formats with significantly different affordances, and hasn't appeared to have all sorts of compatibility headaches as a result.
- layer8 3y agoIntegrating a whole separate language ecosystem is one or two orders of magnitude more complex though. It’s more like HTML5/WHATWG suddenly adding Python as a first-class scripting language besides JavaScript, and web browsers having to integrate that.
- bafe 3y agoIsn't this what people are trying to do with pyscript? Although in that case it uses WASM?
- nprateem 3y agoI wonder who'll be the first to ship python in a major browser
- gpjt 3y agoThere's https://pyscript.net/ https://pyscript.net/ -- or do you mean for scripting the browser's behaviour rather than replacing JS in website code?
- nprateem 3y agoYeah, making python a first-class browser scripting language to displace JS. I think we all know it's time. Even if it takes a decade for ubiquity, it'll be worth it.
- gpjt 3y agoDefinitely check out PyScript if you haven't already. It works pretty well and is being actively developed. (Full disclosure: I work for Anaconda, which is the primary developer.)
- nprateem 3y agoThat's cool, thanks for sharing. I've only ever seen things that required transpilation and had complex toolchains. I hope it catches on
- nailer 3y agoDirect link to announcement: https://techcommunity.microsoft.com/t5/microsoft-365-blog/introducing-python-in-excel-the-best-of-both-worlds-for-data/ba-p/3905482 https://techcommunity.microsoft.com/t5/microsoft-365-blog/in...
- petepete 3y agoFinally the Resolver One dream is coming true, just 15 or 16 years late. https://www.youtube.com/watch?v=u6EV2jiKRfc https://www.youtube.com/watch?v=u6EV2jiKRfc
- gpjt 3y agoInterestingly enough, when Resolver One didn't work out in the marketplace, we pivoted to PythonAnywhere. That took off nicely, and was acquired by Anaconda last year. And now Anaconda is realising those old dreams :-) BTW for clarity: the team working on this inside Anaconda is entirely separate from the PythonAnywhere team. It would have made a perfect Hollywood-ready story if it had been the same people...
- kdeldycke 3y agoWe were discussing about Resolver One 6 months ago at: https://news.ycombinator.com/item?id=34819682 https://news.ycombinator.com/item?id=34819682 One mystery we did not resolve (pun intended) was why it did not find its audience. Was it too early? Was data science not established enough as a field? Was it because it was not Excel (i.e. the dominant tool)?
- gpjt 3y agoI think it was a combination of those, plus terrible market timing -- we released it, thinking we could sell to finance types, in 2008. In our sales pipeline spreadsheet, the "notes" column started saying things like "customer has gone bankrupt".
- petepete 3y agoWow, thank you for replying. I'm so glad it worked out in the end. I remember being blown away by the ResolverOne demonstration video, and if I recall correctly, some others you posted showing some of the other features and functionality. The fact VisiData (my current 'spreadsheet' of choice) has acquired a sizeable following in that niche, and now Excel is following suit suggests you might have just been a little too far ahead of the curve.
- diffeomorphism 3y agoWait just a moment. Libreoffice had python for years, but nobody cared and instead complained about needing 100% compatible VBA for "real work". Where are those people now?
- jenscow 3y agofinding another straw-man?
- Bjartr 3y agoNot offended that Excel can do more, but potentially still inconvenienced by Libreoffice not having the thing they are familiar with or are forced to work with?
- PurpleRamen 3y agoIf it sucks, people won't use it. If people don't know about it, people won't use it. If people are accustomed to something different, people will ask for it.
- BeetleB 3y agoThe problem with Libreoffice was that the python support was purely documented.
- iso8859-1 3y agoI wrote some new docs on this recently: * https://wiki.documentfoundation.org/Macros/Python_Guide/Calling_Python_from_Basic https://wiki.documentfoundation.org/Macros/Python_Guide/Call... By having Python in Basic, it becomes available to cells too, since Basic macros are callable from cells. Note that you may need to reduce the security level to 'medium' in the drop down Tools->Options->Libre Office->Security->Macro Security. When LibreOffice opens, it will ask you whether you want to enable macros or not.
- amon22 3y agoI would happily use Libreoffice if any of my clients did. But nobody does. Compatibility would be nice so I can write stuff in Libreoffice Calc on Linux (Excel has 0 Linux support) and ship it to clients without issues, but this even close to be possible.
- bilsbie 3y agoOff topic but why can’t we all go back to office 97? It basically does all the same stuff and it would be lightning fast on modern machines. You don’t even need internet to use it.
- itomato 3y agoThank you. Yes, I could get ELT to accept a “RAD” Access app built and shipped during the time it takes to pitch to choose just the CRUD library or JS Framework alone.
- unnouinceput 3y agoNone's stopping you to use MSOffice '97. I still use it from time to time and current MSOffice is happily recognizing the format and converts it on the fly. Also there is a tool that you can install and see current formats to be able to open them in MSOffice '97. As for why the rest of the world why would do that or not, is their choice, no?
- baz00 3y agoYeah strangely if you turn the ribbon off it doesn't look much different and doesn't work much differently!
- postexitus 3y agoYou say 65k rows is enough for anyone?
- hermitdev 3y ago> why can’t we all go back to office 97? For one, because people want more than 65,536 rows in their spreadsheets. But, I'd largely agree that '97 was the pinnacle from a UI perspective. There are changes under the hood that are quite nice, though, especially with the move to xml persistence.
- shadowtree 3y agoXLOOKUP.
- starquake 3y agoI'm a developer. People have often come to me with Excel sheets that were really slow because it was just too much for Excel. Almost all of the times IMHO a specific solution should have been developed for it. I'm curious to see if this makes it better or actually worse.
- mcdonje 3y agoConway's law. Unless those people have devs or data engineers embedded in their group, they're going to keep on with less than ideal solutions. Management will accept those inefficient solutions because they don't come with dev pricetags.
- pessimizer 3y agoI don't doubt that you have, but in my experience the reason they're slow is because updates haven't been turned off while the macro was running, or naïve algorithmic choices (that a query planner might fix in the realm of normal programming, but python wouldn't help with.)
- mcdonje 3y agoI hope this is the start of a wholesale python replacement for VBA. Python has turned into what VBA always tried to be: A ubiquitous language for data and scripting (among other things). Excel would be well served by replacing VBA with either JS or python because of their ecosystems and high levels of adoption. Python is the better choice because data analysts are more likely to be familiar with it.
- nologic01 3y agoI wish Libreoffice would have smelled the coffee long time ago. In principle scripting using Python is possible but exceedingly cumbersome/ugly and there seems to be no roadmap to improve on this. The same warning applies to the linux desktop and all its apps more generally. Increasingly proprietary platforms will be rolling out advanced "AI" functionality extensions to classic apps that are cloud based, many of them via a Python API. Its a pity that the various strands of the open source universe are so siloed. The potential of the sum being more than the parts is squandered.
- tzs 3y agoI think in a lot of cases its not even the advanced stuff that keeps people on Excel and other proprietary things. It's the seemingly little things. My biggest beef with LibreOffice's spreadsheet (and with Apple's Numbers) is how they handle copy/paste of discontiguous selections. Consider this 5 row by 3 column set of data: 1 2 3 4 5 6 7 8 9 a b c d e f Suppose you select the 1 2 3 row, the 7 8 9 row, and the a b c row, copy them, and paste just below the d e f row. In Excel you get this (first 4 rows omitted for brevity): d e f 1 2 3 7 8 9 a b c In LibreOffice and Numbers you get this (empty cells denoted by "-"): d e f 1 2 3 - - - 7 8 9 a b c I haven't found a setting to change this. Excel doesn't have a setting for this either as far as I know, so people who do want discontiguous copy/paste to preserve spacing would probably be as irked by Excel as I am by LibreOffice and Numbers. But I don't think I've ever actually wanted the spacing preserved so it is LibreOffice and Numbers that irk me.
- tzs 3y agoThis sounds like it provides a way for Excel to hand a bunch of data to Python code for processing and get back results, and vice versa. That's probably extremely valuable to many people, but it does not seem to be what I hope for whenever I see something about bringing Python to Excel. What I hope for is something that is like VBA but without the VB. I.e., a Python (or JavaScript) interpreter/JIT/compiler built into Excel exposing all the internal Excel objects and methods that VBA has access to. By "Python" I just mean the language and whatever subset of the standard library makes sense in Excel.
- FredPret 3y agoThat would be very cool. Python with Excel as the GUI.
- jodrellblank 3y agoInstall PyWin32 module and `import win32com.client` and you can access "all the internal Excel objects and methods that VBA has access to". C:\>python Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from win32com.client import Dispatch >>> xl = Dispatch("Excel.Application") >>> xl.Visible = True >>> wb = xl.WorkBooks.Add() >>> sh = wb.WorkSheets[0] >>> sh.Range("A1").Value = "Hello World" >>>
- fzumstein 3y agoThe same with xlwings (works on macOS, too): >>> import xlwings as xw >>> wb = xw.Book() >>> sh = wb.sheets[0] >>> sh["A1"].value = "Hello World"
- jodrellblank 3y agowin32com.client uses Windows' COM machinery, which supports event-driven feedback from Excel to the script. Switching to PowerShell because I'm not familiar with that in Python and from a quick Google, Python needs some more complex multithreadding handling: $xl = new-object -ComObject excel.application $xl.Visible = $true $wb = $xl.WorkBooks.Add() $sh = $wb.Worksheets[1] Register-ObjectEvent -InputObject $xl -EventName SheetChange -Action { Write-Host "Hi" } Now when you change a cell in the spreadsheet GUI and press enter, the PowerShell "write-host" runs and prints the message. Another comment mentioned "using Excel as a GUI for Python" and the COM interfaces have the machinery to do that. It looks like xlWings has something like this, but may need an add-in installed in Excel to trigger Python code from Excel? https://docs.xlwings.org/en/latest/quickstart.html https://docs.xlwings.org/en/latest/quickstart.html and https://docs.xlwings.org/en/latest/addin.html#xlwings-addin https://docs.xlwings.org/en/latest/addin.html#xlwings-addin
- curiousgal 3y agoMeh, as an advanced user on a trading floor we don't need Python for Excel to run on the cloud, we need it to run locally so we can tap into our in-house C++ library and KDB databases. Third-party solutions have so much overhead.
- icapybara 3y agoSounds like you're doing something too sophisticated for Excel.
- curiousgal 3y agoWe are essentially using it as a UI for the traders.
- pasc1878 3y agoYou don't know what Excel does. This is normal Excel use. Most large organisations use an Excel front end to their enternal services and the uses uses VBA to put them together. - Basically Excel is the finaciers web browser. Unfortunately they also have large Excel spread sheets that are passed around between users with no control. An examplke was in UK reporting of some COVID information, it was underreported as they were using Excel which only allows 64K (number chnages per version I think it was 256 originally) rows and so when exporting data rows were just lost.
- diarrhea 3y agoC++ FFI from Python from Excel. Now this is podracing.
- pasc1878 3y agoProbably not needed as if you need that you already doing Excel C FFI.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- sneak 3y ago> “I’m excited that this excellent, tight integration of Python and Excel is now seeing the light of day,” says Guido van Rossum, Python’s creator and now a Microsoft distinguished engineer. It's depressing seeing someone who has done so much work for the free software community now working to enrich the spyware-laden proprietary product offerings of a megacorp. Nothing about this is "good for Python" or hackers - it's just good for Microsoft to sell more Excel (and Microsoft accounts). That makes the world worse. I thought the B stood for benevolent.
- Bostonian 3y agoEven installing Python seems to a hurdle for many employees. They need to get approval from IT, and it seems not to get done. They use Excel, and if they can use Python within Excel without installing anything extra, it will increase the user base of Python. After getting a taste of Python they may install Python locally and use it outside Excel. So I think this will be "good for Python". Certainly integration of VBA into Excel has been good for VBA.
- diarrhea 3y agoHere I was, hoping he worked on performance, typing, dependency management or other hard, meaningful issues in the Python ecosystem.
- IshanMi 3y agoA lot of people are taught Excel early on in school. I wonder if this would result in more people learning or being introduced to Python at an early age?
- pessimizer 3y agoPeople aren't taught VBA in school, as far as I know, and that was already there.
- sixothree 3y agoNow if they could only fix the issue where dates are converted into scientific notation. For the past 10 years I've been getting a steady stream of excel files with sometimes thousands of dates that are formatted incorrectly. And there is literally no "easy" way to fix this. I'm tired of it Microsoft. Just fix the darn issue please.
- PurpleRamen 3y agoSeems cool, and a bit awful. Writing elaborated python-code in that little text-field must be a nightmare of its own. Where can I connect a VS Code or vim to the sheet for coding in comfort?
- Spinnaker_ 3y agoExcel has an editor. Try hitting alt+f11. "Open in vscode" would be an excellent feature though.
- pessimizer 3y agoNo one seems to know that an VBA IDE is part of Office. It's important to remember when you're working on an extremely locked-down system and you want to do something complicated.
- diarrhea 3y agoMy thoughts too. Not having to install outside software is treated as a feature, but it is a lost opportunity: Excel with tight VSCode integration sounds like a killer app for decades to come. Two best-of-class (respectively) programs, each in realms dominated by Microsoft. Combine the two and unique possibilities unlock, bridging the gap between business and development.
- eggy 3y agoI am using Acceλerate for MS 365, which brings Visual Scheme for Applications (VSATM) to the MS 365 suite [1]. It can be used in the other MS 365 apps as well and ties in nicely to .NET. That and I unashamedly love Lisp over python even though I know python has the data science corner. I was very disappointed when MIT replaced Scheme with Python as their CS intro language, but such is life. For kicks, I am a big APL fan and found April (Array Programming Re-Imagined in Lisp) which has APL and Lisp united into a super PL! [2]. Maybe an APL for Excel? [1] https://code-magazine.com/Article/2207071/The-Excellent-Schemer https://code-magazine.com/Article/2207071/The-Excellent-Sche... [2] https://github.com/phantomics/april https://github.com/phantomics/april
- gorkish 3y agoTBH I'd rather have Excel sheets in Jupyter than have Python in Excel.
- baz00 3y agoI have to see some red flags here. The very nature and power of Excel comes from the fact that workbooks can stand alone. This means that the process is eternally tied to the cloud now. So when you, 3 years down the line, have to open a workbook from your deceased colleague, you are at the whim of the vendor supporting the existence of this integration. Step one of any workload will always be "work out how to make the software work again" and that's terrible. I know this because I have been in that situation several times in the last couple of decades with random Excel, outlook and word add-ins. And those don't even do the processing remotely!
- duxup 3y agoYeah I’ve received so many broken Excel documents and it’s just constant frustration. Half the things don’t work, customer is sure it worked in X ( now broken and invisible way ) and they really don’t remember that correctly.
- mrits 3y agoI haven't used a non-cloud spreadsheet in probably 7 years. I also wouldn't use excel for anything that has a combination of high importance and long lifetime though. It's mostly for some brainstorming or thrown in a presentation as a screenshot.
- csdvrx 3y ago> I haven't used a non-cloud spreadsheet in probably 7 years. Last time I use a cloud spreasheet was a month ago, to download the content into Excel > I also wouldn't use excel for anything that has a combination of high importance and long lifetime though. It's mostly for some brainstorming or thrown in a presentation as a screenshot. It's funny but that's exactly how I see online spreadsheet: for unimportant things that may not work at any point in the future if the account is closed. However, the collaborative features make them nice for brainstorming.
- mrits 3y agoIf I had to download content locally I would tell them to resend a csv. I hope you are doing this on a VM
- chad1n 3y agoWhile I can see the advantages of Python over VBA, I feel like running the code in the cloud instead of locally will be a big no from a lot of people, especially enterprises running offline Office installations.
- Qem 3y agoNow that Microsoft embraced Python, what are the odds it will go all the way to extend and extinguish it (or at least CPython as reference implementation)? There are much more excel users than programmers. If excel runs Python, it has the potential to become the "de facto" standard interpreter, used by most people worldwide, displacing CPython.
- kortex 3y agoBetween nil and zero. Just because excel is "bigger" by various metrics, does not give MS any more ability to quash Python. The software world is way larger than it was in the heyday of EEE. Excel still has a fraction of the power Python does, it's not becoming "de facto" anything that it isn't already de facto for (which is highly interactive data wrangling and making reports by folks who cant/won't use a python env for that task).
- al_be_back 3y agovery smart move! clearly aimed at big business/enterprise customers, python's ecosystem of scientific & statistical libraries is massive not so long ago they introduced Office Scripts and Power Automate, in essence coding macros in TypeScript (rather than VBA), again only for business/enterprise license users though.
- gpjt 3y agoBack in 2005, some friends and I started a company called Resolver Systems to build a Python-enabled spreadsheet, which we called Resolver One. Sadly, it never took off in the marketplace, and we had to pivot; we would up creating PythonAnywhere, an online coding and hosting environment, which worked out pretty well and was acquired by Anaconda last year. And now, the circle is closed :-) (Just for clarity: the team working on this inside Anaconda is entirely separate from the PythonAnywhere team. It would have made a perfect Hollywood-ready story if it had been the same people...)
- mritchie712 3y agoI built my first app on PythonAnywhere! I've had stuff running on there for almost a decade now. I loved being able to make small tweaks to the app directly in the PythonAnywhere web app. Such a great product. Really missed stuff like that when I started using GCP/AWS.
- gpjt 3y agoThat's awesome, glad you like it :-D
- rich_sasha 3y agoPythonAnywhere is awesome :) like the other commenter it was my first foray into web programming too!
- vegabook 3y agoIt was a great product - I remember your pitch and indeed we met a few times at the London python for finance meetup (remember the "Enthought Python Distribution"?). The only issue is that Resolver was IronPython-based so there were a bunch of libs that kinda didn't work.
- JNRowe 3y agoI have to second that, it seemed to be a great tool. I've often wondered why it couldn't get traction¹. I can recall people gushing about it at what may have been the same Python meetup in London, and also people being impressed enough by it at a Haskell meetup that they were lamenting an imagined lost opportunity to shove a "real language" in to a spreadsheet ;) I'd always kind of assumed that the target audience would have appreciated the IronPython use, as the .net ecosystem would likely have been more valuable to them. Having just looked I see that numpy wasn't available on IronPython until 2010, and I'm sure that would have been useful to have a little earlier. ¹ Pretty sure I've referenced it here a few times too.
- Bostonian 3y agoI am the sole Python developer in a company where everyone uses spreadsheets. With this project, will my coworkers be able to run my Python functions? Or only functions that are built into Python and packages like pandas and NumPy?
- jollyllama 3y agoThis is a nightmare. Python devs are going to be asked to support the half-baked python macros of business users.
- Nifty3929 3y agoI was so excited about Python in Excel, until it said "run in the cloud." There just doesn't seem to be any reason for this except to tie you into their cloud service. It feels so much like protecting me from unsafe printer ink. I'm generally a fan of MS Office products and try to give them the benefit of the doubt. Please help me think of a plausibly good reason for requiring Python to run in the cloud, that is not just about lock-in.
- _untra_ 3y agoNot asking customers to manage a local python installation is one thing, although I totally understand how excel + python power users would likely be comfortable bringing and maintaining their own python runtime.
- leetrout 3y agoFun fact: Microsoft shipped Python code in 1996. The could do it again if they really wanted to. http://python-history.blogspot.com/2009/01/microsoft-ships-python-code-in-1996.html http://python-history.blogspot.com/2009/01/microsoft-ships-p...
- raincole 3y agoDoes Excel run in a browser today? There are a lot, I mean a lot apps that support scripting languages and don't need you to manage the language's runtime yourself. Blender's UI is entirely in Python. Civilization games have most game logic in Lua.
- yonatan8070 3y agoInkscape (vector graphics) also has a built-in Python install, same goes for Cura (3D printing), Fusion 360 (3D CAD), and I'm sure many more
- skrause 3y agoYou can just ship a copy of Python with Excel, no need to ask anybody to maintain their own installation.
- catboybotnet 3y agoAw, shoot. I thought I would be able to have fun sending coworkers: import os os.rmdir("C:\Windows\System32")
- make3 3y agoshutil.rmtree, unless their System32 is empty
- WillAdams 3y agoIt'll certainly be a lot easier and more accessible than pyspread: https://pyspread.gitlab.io https://pyspread.gitlab.io (which I wish was more widely known/used)
- narcraft 3y agoBold prediction: this will have a greater economic impact than LLMs over the next 10 years.
- qwertox 3y agoI'd say they are doing this because of LLMs, so that normal users can tell Excel what it should be doing, and it then generates a script which can execute it.
- fzumstein 3y agoxlwings creator and author of the O'Reilly book "Python for Excel" here! First of all, big congrats to the team! I've been in contact with the Excel team on and off over the years and I remember when an Excel project manager once described the task of adding Python to Excel as "turning a fully loaded ship". Well, I am happy that the ship has now turned and is ready to ship into more exciting waters! There are a few question marks I have given my decade long experience with the topic (although everything is still beta, so it will certainly change/improve on its way to GA): (1) I have hardly seen any company that can do with an off-the-shelf Anaconda distro. Companies usually have an internal Python package that they will need to access. (2) When running Python on the backend, the first question is always "how can we authenticate the user"? Office.js is currently the only platform I know of that allows you to leverage Azure AD identities via SSO or use any other provider (as you have complete freedom to use any JS library/redirect the user to a login form). (3) IT policies: Usually, companies have made their cloud decision: “We're an AWS/GCP/Azure shop, so Python has to run on precisely AWS Lambda/GCP Cloud Run, etc.” Yes, many are on Azure, but even in Azure they may have preference of let's say Azure Container Apps or AKS instead of Azure functions. (4) The other thing that businesses are obsessed about is to securely protect their source code, again, not something that Python in Excel seems to support. (5) And finally, what I see users most excited about in the context of xlwings is being able to run standard User-defined functions (aka "Custom functions) on the server (like the ones we wrote in the good old VBA times or like the new Lambda functions), not sure if that's possible or on the roadmap for the official version. With the modern xlwings Server, I have taken a different approach: Let users build a 100% standard Python web app using their favorite framework (Django, Flask, FastAPI, ...) including all the standard tools (logging, auth, etc.) while using Excel as the frontend. Users have complete freedom in choosing their tech stack, they can version-control the source code on GitHub, use GitHub actions to run unit tests and deploy the code automatically to their favorite cloud, etc. So I am probably targeting more professional developers than data scientists, but in my experience, it’s often a professional developer who write the Excel add-in that is then deployed to business users/data scientists.
- sauwan 3y agoHow will this work in practice? Will this just be python version 3.XX forever? How will packages be maintained? Do you get to specify any of this so when a future version of a package is introduced without backwards compatibility it doesn't break everything immediately?
- hiccuphippo 3y agoIt seems it took 6 years from "consideration" to an actual release: https://news.ycombinator.com/item?id=15927132 https://news.ycombinator.com/item?id=15927132
- twobitshifter 3y agoIt’s interesting but if you are good enough at Python, can’t you already write to and read from spreadsheets? Maybe moving up a Python excel library like xlrd and openpyxl and making it reactive would be more worthwhile for Microsoft. Writing Python code in that little formula bar as shown doesn’t seem attractive. Writing Python in VSCode and seeing the results appear in the spreadsheet in real time would be great though.
- amon22 3y agoNo, you use Excel when you need a data manipulation program quickly and you want to ship it to clients without any installation or training. You just send the workbook to your client and it's done! It's very self-contained, what works on your machine is almost guaranteed to work on the client's computer, given that they have the same Excel version. It's also very reliable, VBA apps can work for years without any maintenance or support. Openpyxl is fine if you want to generate a report and send the results but for anything dynamic you would need to ship an interpreter, plus generate an exe, plus ship a workbook with the data, plus you probably need to write a GUI (users freak out from the cmd). This is much less reliable and requires constant support to users, VBA/excel apps rarely do. This Python integration is a bit disappointing though as the "killer feature" of Excel is that it's self-contained and now it will rely on MS's cloud. This is yet another integration that will fail to kill VBA (we had JS and .net already but had similar issues), it seems that MS doesn't really understand how people use Excel :)
- twobitshifter 3y agoGreat points, since it’s in the cloud it’s no longer self contained. We are already in some hybrid works with extra dependencies. And if that’s the case, why can’t the .py files live in the cloud too? The need for an interpreter didn’t go away, Microsoft is just hosting it for you.
- TrackerFF 3y agoI've worked at places where we were not allowed to install Python, nor were we allowed to run executables that weren't greenlighted by IT beforehand.
- cpursley 3y agoRelated: https://www.quadratichq.com https://www.quadratichq.com
- dragonwriter 3y ago> Microsoft says Python in Excel will be included in a Microsoft 365 subscription during the preview, but “some functionality will be restricted without a paid license” Microsoft 365 subscriptions are paid licenses. This sentence is nonsense.
- jimmychoozyx 3y agoDIY: -> excel cell: rest api call -> send request to your own python web app: run python function. send back the output.
- snickerbockers 3y agoSo what happens when you're trying to work on your laptop and you don't have a reliable Internet connection?
- ayhanfuat 3y agoDisappointing: > Python in Excel is currently available to users running Beta Channel on Windows. This feature will roll out to Excel for Windows first, starting with build 16.0.16818.2000, and then to the other platforms at a later date. [1] > Python in Excel is available in Excel for Windows. The feature is not available in Excel for Mac, Excel on the web, Excel for iPad, Excel for iPhone, or Excel for Android. On unsupported platforms, workbooks containing Python can be viewed but Python cells display an error when recalculated. [2] [1] https://techcommunity.microsoft.com/t5/excel-blog/announcing-python-in-excel-combining-the-power-of-python-and-the/ba-p/3893439 https://techcommunity.microsoft.com/t5/excel-blog/announcing... [2] https://support.microsoft.com/en-us/office/introduction-to-python-in-excel-55643c2e-ff56-4168-b1ce-9428c8308545 https://support.microsoft.com/en-us/office/introduction-to-p...
- codethief 3y ago> Python calculations run in the Microsoft Cloud A colleague was joking, "I guess even Microsoft itself isn't able to manage local Python installations on Windows…" But imagine if Microsoft actually managed to finally solve the "setup a local Python environment" situation once and for all and Excel became the standard Python package manager across operating systems! $ excelpip install fastapi==9.11.23 Searching for fastapi version 11.09.2023…
- nxobject 3y agoMy mind can't help think of the following problem... would Microsoft have to freeze an LTSC set of packages? How would $GOV_AGENCY using a version of Excel one generation behind collaborate with the world?
- dogleash 3y ago> A colleague was joking, "I guess even Microsoft itself isn't able to manage local Python installations on Windows…" I've been waiting for Microsoft to solve package management on Windows since I played around with debian's apt 20 years. That's not snark, it seemed like Microsoft's product complexity and dedication to backwards compatibility of software would make them the ones to move software management forward. Really dig into the problem space and reinvent the package manager beyond anything that's come out of the open source space. Instead we've got windows update, windows features, microsoft store, software center and winget (you know, that Microsoft-built package manager for Windows you install from the other Microsoft-built package manager for Windows).
- LexiMax 3y ago> It seemed like Microsoft's product complexity and dedication to backwards compatibility of software would make them the ones to move software management forward. That's precisely why they _didn't_ go with the package manager model of software distribution. Package managers in most distros assume that everything you download via apt/dnf is a part of the operating system and integrates with whatever dependencies the OS ships with. It's a great system if you're an operating system maintainer, but terrible if you're a third-party software developer who has no interest in dealing with 5-6 different OS's repo formats and dependency versions. On Windows and macOS, you vendor most everything, provide runtime installers for the rest, and that's usually enough to be resilient to bitrot. Package formats like Flatpak, Snap and AppImage are the only projects who seem to be taking the problem of software distribution on Linux seriously, and of those only Flatpak seems to have the mature tooling and lack of myopia necessary to pull it off. For the times that I do miss apt on Windows, chocolatey is pretty good at installing software and vcpkg works great for linkable libraries.
- MassiveBonk51 3y agoThis seems like pretty bad news for all the excel but programatic type startups I've seen floating around. Being able to work locally might be their only hope.
- danten12 3y agoWhen I worked at a hedge fund being introduced to Python after years of working in spreadsheets was a revelation. ChatGPT/Copilot have dramatically reduced the cost of switching to the IDE for bankers/investors/consultants who make up Microsoft 365's core user base. Surprising that Microsoft would give users this gateway drug, but I suppose the reasoning is that you can keep your users by making Excel a quasi-IDE.
- pasc1878 3y agoExcel was already a quasi IDE 30 years ago even without VBA. Excel macros and the C FFI interface worked. I suspect HN users in general are different to finance users and so have not seen how Excel is used.
- tycho-newman 3y agoWhat's wrong with openpyxl? Heck the .xslx file format is fancy XML.
- dsagal 3y agoGrist is a spreadsheet with Python support (I am a founder). Python does make some formulas far easier. Nice to see Excel has data science libraries included from the start, that's something we've had our eyes on for a while. On the other hand, Grist is open source and can be run locally.
- ikrenji 3y agodoes it make you nervous to basically have microsoft as your primary competition now? :)
- dsagal 3y agoIt's a spreadsheet, Excel was always our primary competition! :) The more Excel follows us, the better for everyone. Python is a start, but they have a way to go. Imagine proper relational data, self-hosting for cloud Excel, open-source, access rules....
- enthus1ast 3y agoSince a few month i use grist extensively. For example: As part of a monitoring system. HR / crm Database. Self serving vacation planner and approving system. Tamperproof GMO(genetically modified organisms) database. As my go to source as a quick and dirty data dump while hacking... Grist is a great tool!
- gradascent 3y agoI imagine this is a stage in a larger plan to incorporate an AI assistant to excel? Being able to talk to your spreadsheet in natural language and have it do a bunch of analysis and visualizations would be a huge productivity booster.
- swyx 3y agoworth checking out Quadratic for an open source approach to Python + Spreadsheets: https://news.ycombinator.com/item?id=35456509 https://news.ycombinator.com/item?id=35456509 theres going to be multiple people tackling this problem but I see it as a worthy one, theres no reason we should be needing VBA in the future when we can run Python in browsers.
- debitcredit 3y agoWe're building Python (mainly python pandas) + Spreadsheets at op (https://opapp.io https://opapp.io). Would love to know what you think. The code editor is more like a built in code notebook.
- nxobject 3y agoI look forward to seeing this get abused. Having worked with a psychometric analysis program entirely implemented in VBA, I genuinely wonder how Excel/Python will live alongside R in academia - at least for the people who are really conservative about the tools they use.
- sharts 3y agoYou can always count on out of touch Microsoft PMs to over salt a good idea. Always one step forward, two steps back, and one to the left. I remember interviewing in Redmond once and the PM couldn’t understand why Windows Vista wasn’t doing well because it seemed to run excellent on his overpowered PC.
- andromaton 3y agoHalf joking: Now we know why Microsoft hired Guido.
- andromaton 3y agoMake that 10% joking https://twitter.com/gvanrossum/status/1694031794306458056 https://twitter.com/gvanrossum/status/1694031794306458056
- vba 3y agoThis was a nice surprise to see today as an Ex-Excel developer who worked on trying to bring Python to Excel (and, I guess, failing ;)). 7+ years ago I had the option of leaving the Excel team. My then boss’s boss knew I had an interest in bringing Python to Excel and offered me a chance to tackle it if I chose to stay. What was meant to be a 6 month project turned into a ~3 year project, the Python part faded away and we ended up enabling JavaScript Custom Functions in Excel instead. For Python we were also running ‘in the cloud’ (AzureML v1), although there was some back-and-forth on if we should run locally. I think what made the Python part disappear was our partner AzureML team re-orged, re-released, re-hired, we lost a PM and our work caught the attention of another partner team who realised they could use our code to execute their JavaScript out-of-process. And so I spent a lot of time ensuring that feature was successfully shipped at, I guess, the detriment of Python. I had a lot of help from some strong engineers and learnt a lot. The core of the work was modifying the calculation engine of Excel to allow functions to compute asynchronously, allowing the user to continue working on other parts of their spreadsheet while the remote endpoint (be it JavaScript, Python or something else) was computing. Previously the spreadsheet would lock up while calculations were running, and that wouldn’t be cool for long-running unbounded calculations. Have to wonder if any of the stuff we built made it into this new feature. Super great to see this and look forward to trying it out. Recalc or die
- smitty1e 3y agoGreat user name. I have a private github repo called NVBC, the "NecroVisualBasiCon", with all of my favorite VBA-isms. When I code it, I indent all of the `End *` lines to column 80, to make the VBA look more like python.
- fzumstein 3y agoThanks for your work! The async JS functions are amazing and allowed me to ship rock-solid Custom functions with xlwings and Python. The problem with Office.js is that it’s just simply too hard to get started with all the npm bloat for the average Excel user (even more professional devs struggle). Well, I am pretty happy how I am saving users from having to use Node.js: https://docs.xlwings.org/en/latest/pro/server/officejs_custom_functions.html https://docs.xlwings.org/en/latest/pro/server/officejs_custo...
- steno132 3y agoMany comments are criticizing the fact that this only runs in the cloud. And if Microsoft instead announced this would only run locally, they would instead be deploring the massive remote code execution vulnerabilities that this opens. For this feature, there's no question that providing it in the cloud is much, much better for security. Microsoft can now execute the Python code in Firecracker VMs which provide much better sandboxing than your local PC could.
- globular-toast 3y agoMy local PC can run code in Firecracker VMs.
- lost_tourist 3y agothat would be a different set of people though. Some people are fine with cloud everything some of the rest of us aren't and like to work local. Especially for something as basic as a spreadsheet or word doc.
- dicytea 3y agoIt's interesting how aggresively enthusiastic HN are about Excel when it comes to discussions about Excel vs. open-source alternatives. Any mention of alternatives are quickly and aggresively shot down, ocassionally to the point of personal attacks (if you're satisfied with LibreOffice you don't have real job, etc.). On the meanwhile, just a few threads ago there was a (quite fair) browser benchmark where Chrome comes up on top on almost every test. People in the comments instantly rushes in proclaiming how proud they are for using Firefox even if it is technically inferior, solely because it is not owned by Google. What's up with this divide? Firefox user, btw.
- maigret 3y agoI think it comes from users being deceived by the product UX. My impression is that using Firefox, I often don’t miss other browsers. Using Libre Office makes me miss Excel, Keynote et al. I can’t pinpoint it to a single thing, it just feels dated and inferior. Open source in general seems to work better for infrastructure than applications, even if I have my own favorites. It partly has to do with the lack of product teams like designers, but also that an app is a single endpoint that makes a hard business to sell multiple flavors.
- nullifidian 3y agoI've been saying that Python is the modern day's Visual Basic and now it has become the actual "Visual Basic".
- tinyspacewizard 3y agoExcel single-handedly keeps VB alive; it has a huge amount of sway over what langauges people use and learn - so why settle for Python?
- RobinL 3y agoDoes anyone yet have a full list of the supported python libraries? There's a partial list here: https://support.microsoft.com/en-gb/office/open-source-libraries-and-python-in-excel-c817c897-41db-40a1-b9f3-d5ffe6d1bf3e https://support.microsoft.com/en-gb/office/open-source-libra...
- Aaronstotle 3y agoDoes this mean you can get an infected Excel file that use python macros? This is a serious question, I know a lot of attacks use Excel macros.
- ChrisArchitect 3y agoOfficial blog post: https://news.ycombinator.com/item?id=37223257 https://news.ycombinator.com/item?id=37223257
- CafeRacer 3y agoNice, waiting for the new machine on HackTheBox :-D
- infamia 3y agoThere is an interesting looking competitor in this space that is built with Python integration from the ground up. https://www.neptyne.com/ https://www.neptyne.com/ I haven't tried it yet, nor am I affiliated with Neptyne, but it looks intriguing.
- kbelder 3y agoHmm, I would have gone with "Nyptune". But it looks nice. Looks fun to work with.
- racl101 3y agoHELL YEAH!
- timetraveller26 3y agoIs this the end for internal javascript frontends? Should I learn python for Excel instead of Django?
- ianmcook 3y agoAnyone know what format they are serializing the data in to move it between Excel and Python? Are they using Apache Arrow?
- version_five 3y agoFrom my skim they are incorporating a new-ish release of python. I wonder how long until (and if) MS forks python to add some functionality (extends it) and what happens next. Is it that farfetched to picture corporates running MS python with dot net integration or something and the ecosystem getting all screwed up.
- Ikatza 3y agoThis would be a good moment to ask for good free Python courses.
- debitcredit 3y agoIf you're interested in something like this with a bigger code notebook-style code editor + AI code generation, we're working on it at op (https://opapp.io https://opapp.io).
- bubblebobble 3y agoThis is so weird. I built a "python within excel" a few years back. Abandoned now: https://alphawolfxl.com/ https://alphawolfxl.com/ It allowed python functions to be run on cells and ranges, and also allowed ranges to be filled with sql queries on databases. I had managed to get also a matlab runner working (via matlab/java connector) and was just getting the R connector finished. Basically, I made a website showing it working and gave a few people the plugin, and their feedback was "nah, my company won't pay for it, you're wasting your time" - so I shelved the project. I have no idea what my emotions are doing right now :)
- TalhaKhan99 3y agoIs this feature primarily a function of web assembly? I.e because if we assembly you can run python natively in the browser?
- jzawodn 3y agodefinitely_not_malware.xls.py
- bigmattystyles 3y agoI could swear I had seen this headline before, so much so that when I was recently asked to help out in some old vba code, I figured I’d port it over. Imagine my horror when I couldn’t find it. Imagine my horror seeing this now that I just finished.
- rr808 3y agoI work for a big bank. There is no way infosec guys would allow this, its no use to us. Even ChatGPT is blocked.
- MobileDev 3y agoCurious if we can use Pandas like framework to combine excel sheets into 1 (with common columns or specify rule for column merge) once this is launch in an easy way all in Excel?
- mixtur2021 3y agoDoes this allow Microsoft to work around Apple app store restrictions on running interpreted code?
- andromeduck 3y agoWhy not starlark?
- geordee 3y agoI describe Excel as the browser for data apps. Now Python would be the scripting engine for Excel, the “data browser”.
- NoZebra120vClip 3y agoCool a novel malware vector for the uninitiated
- hosolmaz 3y agoRelevant: https://www.quadratichq.com/ https://www.quadratichq.com/