source: ntrip/trunk/BNC/scripts/helpScreenshots/viewer.py

Last change on this file was 11160, checked in by stuerze, 5 days ago

screenshots are updated

  • Property svn:executable set to *
File size: 621 bytes
Line 
1#!/usr/bin/env python3
2"""Simple text viewer window (stands in for a text editor in screenshots)
3
4 viewer.py <file> [columns] [rows]
5"""
6import os
7import sys
8import tkinter as tk
9
10path = sys.argv[1]
11root = tk.Tk()
12root.title(os.path.basename(path))
13text = tk.Text(root, width=int(sys.argv[2]) if len(sys.argv) > 2 else 90,
14 height=int(sys.argv[3]) if len(sys.argv) > 3 else 22,
15 font=("DejaVu Sans Mono", 9), bg="white", relief="flat", padx=6, pady=4)
16text.insert("1.0", open(path, errors="replace").read())
17text.config(state="disabled")
18text.pack(fill="both", expand=True)
19root.mainloop()
Note: See TracBrowser for help on using the repository browser.