Spreadsheet-like widget for Tkinter
Project description
__ __ __ ___ _ _____ _ __
/ /_/ /__ / |/ /__ ____ _(_)___/ ___/___(_)__/ /
/ __/ '_// /|_/ / _ `/ _ `/ / __/ (_ / __/ / _ /
\__/_/\_\/_/ /_/\_,_/\_, /_/\__/\___/_/ /_/\_,_/
/___/
tkMagicGrid is a spreadsheet-like widget for Python + Tkinter.
It can be used to display static data, or to lay out other widgets
as an alternative to calling grid() manually, or to do a bit of both.
tkMagicGrid is designed to be simple above all else. It has no
dependencies outside the Python standard library. Its API is designed
to let you accomplish tasks with as few method calls as possible.
tkMagicGrid is not designed to be erasable. The recommended way
to clear a MagicGrid widget is to destroy it and create a new one.
Both Python 2 and 3 are supported, on Windows and Unix platforms.
Usage
-----
tkMagicGrid consists of a single module, tkmagicgrid (note the module
name is lowercase), which exports a single class, MagicGrid.
A brief example program:
# This assumes Python 3
from tkinter import *
from tkmagicgrid import *
import csv
# Create a root window
root = Tk()
# Create a MagicGrid widget
grid = MagicGrid(root)
grid.pack(side="top", expand=1, fill="both")
# Display the contents of some CSV file
# (note this is not a particularly efficient viewer)
with open("test.csv", "r") as csv_file:
reader = csv.reader(csv_file)
parsed_rows = 0
for row in reader:
if parsed_rows == 0:
# Display the first row as a header
grid.add_header(*row)
else:
grid.add_row(*row)
parsed_rows += 1
# Start Tk's event loop
root.mainloop()
For more information, try "python -m pydoc tkmagicgrid".
Copyright and License
---------------------
tkMagicGrid is released under the MIT License. See the LICENSE file
for more information.
/ /_/ /__ / |/ /__ ____ _(_)___/ ___/___(_)__/ /
/ __/ '_// /|_/ / _ `/ _ `/ / __/ (_ / __/ / _ /
\__/_/\_\/_/ /_/\_,_/\_, /_/\__/\___/_/ /_/\_,_/
/___/
tkMagicGrid is a spreadsheet-like widget for Python + Tkinter.
It can be used to display static data, or to lay out other widgets
as an alternative to calling grid() manually, or to do a bit of both.
tkMagicGrid is designed to be simple above all else. It has no
dependencies outside the Python standard library. Its API is designed
to let you accomplish tasks with as few method calls as possible.
tkMagicGrid is not designed to be erasable. The recommended way
to clear a MagicGrid widget is to destroy it and create a new one.
Both Python 2 and 3 are supported, on Windows and Unix platforms.
Usage
-----
tkMagicGrid consists of a single module, tkmagicgrid (note the module
name is lowercase), which exports a single class, MagicGrid.
A brief example program:
# This assumes Python 3
from tkinter import *
from tkmagicgrid import *
import csv
# Create a root window
root = Tk()
# Create a MagicGrid widget
grid = MagicGrid(root)
grid.pack(side="top", expand=1, fill="both")
# Display the contents of some CSV file
# (note this is not a particularly efficient viewer)
with open("test.csv", "r") as csv_file:
reader = csv.reader(csv_file)
parsed_rows = 0
for row in reader:
if parsed_rows == 0:
# Display the first row as a header
grid.add_header(*row)
else:
grid.add_row(*row)
parsed_rows += 1
# Start Tk's event loop
root.mainloop()
For more information, try "python -m pydoc tkmagicgrid".
Copyright and License
---------------------
tkMagicGrid is released under the MIT License. See the LICENSE file
for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tkMagicGrid-1.0.tar.gz
(8.8 kB
view hashes)
Built Distribution
Close
Hashes for tkMagicGrid-1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67cc6a8146e3ffa245af3ae1aa76a0d9d370bf0620cb96565f84a8c987e03ab8 |
|
MD5 | 78b89d20db5a47a154be0ff356607993 |
|
BLAKE2b-256 | 051ad2ec57fdea3af554128c125bc8f5d837830f104d3cefdb0d0c029002f048 |