![]() |
Excel Help - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Excel Help (/thread-4256.html) |
Excel Help - Gbry71 - Aug-03-2017 I am REALLY new to python. I have used it to open some web pages and used eventghost to take it from there. I have an Excel workbook that has sheets in it named for months of the year. I need to write script that will extract this month and last months sheet and email it to several people automatically. I am fine with changing the sheet names manually if need be, or even finding a way to email the file without python if need be, but can I save a file with only the sheets I need? (example: now it is August, can I save sheets July and August to a file on my laptop?) RE: Excel Help - Larz60+ - Aug-03-2017 This package (only read excel, no write) is probably the easiest to use if you only have to do simple extractions: https://pypi.python.org/pypi/excel/1.0.0 As far as email is concerned, the builtin package: https://docs.python.org/3/library/email.html will not handle SMTP or NNTP but is fine for MIME. RE: Excel Help - Gbry71 - Aug-03-2017 OK you are talking to a complete novice here so forgive my ignorance. but your examples seem to be reading specific rows and columns and not sheet names. plus I don't see a save command. like I said I am really new to this. so could you spell it out to me, or maybe even validate my question. lol RE: Excel Help - Larz60+ - Aug-03-2017 I didn't provide any examples only references to packages that you might use. These packages typically have methods to do sheet extraction. You will need to read the documentation RE: Excel Help - Dazza96 - Aug-19-2017 (Aug-03-2017, 01:30 AM)Gbry71 Wrote: I am REALLY new to python. I have used it to open some web pages and used eventghost to take it from there. I have an Excel workbook that has sheets in it named for months of the year. I need to write script that will extract this month and last months sheet and email it to several people automatically. I am fine with changing the sheet names manually if need be, or even finding a way to email the file without python if need be, but can I save a file with only the sheets I need? (example: now it is August, can I save sheets July and August to a file on my laptop?) I use the xlxswriter module for all my excel work in python http://xlsxwriter.readthedocs.io/ Admittedly I have only used it to create spreadsheets with my data. It is easy to use and the documentation is well done. Like you I'm new to python only been using for 4 weeks. For emailing your newly created spreadsheet I use the module smtplib https://docs.python.org/3/library/smtplib.html RE: Excel Help - Larz60+ - Aug-19-2017 The xlxswriter module is fine for 'writing' hence the name, but cannot read excel. |