No project description provided
Project description
xlfly - separate GUI based Excel tools
I love xlwings! However, I have noticed it very difficult to handle heavy calculations if using user defined functions. Hence xlfly: making using UDF easier. I chose separate GUI so that I can run parallel threads easier.
Usage
This package only works on Windows
- Write python commands in Excel cells. Select it, click to run!
- Write python in commments section in Excel. Select it, and click to run! Note: if there is comment, the cell value commands will NOT run.
Note: if there is numeric value and a comment on the cell, the cell will not run the numeric value. For example, say "A1" cell has value 1, and comment "sht["A1"].value = 1", you run it. It will not run the "1" in the cell
Create Windows Start Menu Item:
>>> xly --init
Excel selection to "Run Python"
- Write python expressions in the cells
- Select the cell with python scripts
- Click "Run Python" button
I used the icon from https://www.iconfinder.com/search?q=wings&price=free drawn by Monsieur Steven Ankri. Thanks!
Special commands
-
self.run_cell()
Run multiple cells with a command
Example:
run_cell(xw.books.active.sheets.active["A1:A5"])
-
xw.Range.to_link()
Convert the range to link texts values. It is used for cases where you want to preserve the link to update the data in the future
-
self.show_console()
Show the console window. In case you want to give the user indicator info in console window
-
self.hide_console()
Hide the console
Templates
Specify a template root path to have all subfolders as options in the "templates > choose template" menu. Once selected, the main() function in the init.py file in that subfolder will be executed to initialize the template.
This is useful when you want the user to set up the template on the fly
UDF VBA functions - sometimes users wants to have functions they can directly use in the Excel cells. In that case, it is recommended to write *.xlam files with UDF inside, then move it to the user addin directory. Such copy file over operation can be done with xlfly.move_addin() function
PythonPath
When run python, both current workbook
and script_path
setting from setting page will be added to pythonpath. You can put your draft python script file in the same folder as current Excel file to debug.
default folder
Within template folder, you can add "default" subfolder to be added to pythonpath by default, and the default.py file will be imported automatically. This is useful if you want to create Excel use cases where user can work on an empty Excel file without installing anything or making changes to Excel file
Once installing xlfly, the init:setup() will be executed
Debug
To debug the scripts in Excel, run the menu: tools > create debug script. There will be a debug.py file to the same folder as current Excel file. You can start from there to debug
script of the same name from Excel file folder will be imported first.
- Thus you can debug by putting the scripts in the Excel folder
- Once done, move the file to the python path specified in the config page
Error messages will be thrown out:
You can also toggle to show the console at Menu: Tools > Toggle Console
Progress: suggest to use xlwings's app.status_bar = "status message" to display process message
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.