Back to index

python3.2  3.2.2
Classes | Functions | Variables
idlelib.textView Namespace Reference

Classes

class  TextViewer

Functions

def view_text
def view_file

Variables

tuple root = Tk()
string filename = './textView.py'
tuple text = file(filename, 'r')
tuple btn1
tuple btn2
tuple close = Button(root, text='Close', command=root.destroy)

Detailed Description

Simple text browser for IDLE

Function Documentation

def idlelib.textView.view_file (   parent,
  title,
  filename,
  encoding = None 
)

Definition at line 63 of file textView.py.

00063 
00064 def view_file(parent, title, filename, encoding=None):
00065     try:
00066         with open(filename, 'r', encoding=encoding) as file:
00067             contents = file.read()
00068     except IOError:
00069         import tkinter.messagebox as tkMessageBox
00070         tkMessageBox.showerror(title='File Load Error',
00071                                message='Unable to load file %r .' % filename,
00072                                parent=parent)
00073     else:
00074         return view_text(parent, title, contents)
00075 

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.textView.view_text (   parent,
  title,
  text 
)

Definition at line 60 of file textView.py.

00060 
00061 def view_text(parent, title, text):
00062     TextViewer(parent, title, text)

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 Button(root, text='view_text',
00002                  command=lambda:view_text(root, 'view_text', text))

Definition at line 82 of file textView.py.

Initial value:
00001 Button(root, text='view_file',
00002                   command=lambda:view_file(root, 'view_file', filename))

Definition at line 85 of file textView.py.

tuple idlelib.textView.close = Button(root, text='Close', command=root.destroy)

Definition at line 88 of file textView.py.

string idlelib.textView.filename = './textView.py'

Definition at line 80 of file textView.py.

Definition at line 78 of file textView.py.

tuple idlelib.textView.text = file(filename, 'r')

Definition at line 81 of file textView.py.