Re: [Tutor] creating a text widget

2011-01-13 Thread ALAN GAULD
Forwarding to list...

 

> none of it actually.  i am brand new to Tk/Python.  Actually, i don't have a 
>need to do any editing on the file.

OK, display is pretty easy. Take a look in my tutorial under Event Driven 
Programming. 

There you will see a simple text widget with text being inserted. Or look in 
the 
Case Study 

topic for a more extensive GUI with more text being inserted into a text widget.


But perhaps you should try first to write a program that simply pages 
data from your file onto the screen using print() - perhaps limited to 
25 lines at a time? Hitting space should bring up the next 25 lines, 
and so on.

That will give you experience of working with files.

HTH,

Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk/





From: Alan Gauld 
To: tutor@python.org
Sent: Thu, January 13, 2011 1:35:08 PM
Subject: Re: [Tutor] creating a text widget


"W S"  wrote 
> could someone please provide me some code that would create a text widget 
> that 
>i could open a text file in?  
>

You don;t open the text file in the widget as such, you open the file in Python 
as usual and copy its contents into the text widget.

When you are done making changes (if you are making changes) then you have to 
copy the content back out to the file (or rename the original to .bak and 
create 
a new version)

So the question is which part do you not understand?
- Creating a text widget
- opening the file
- copying the file to the widget
- copying changes to the file

HTH,

-- Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] creating a text widget

2011-01-13 Thread Alan Gauld


"W S"  wrote 

could someone please provide me some code that would 
create a text widget that i could open a text file in?  


You don;t open the text file in the widget as such, you open 
the file in Python as usual and copy its contents into the 
text widget.


When you are done making changes (if you are making 
changes) then you have to copy the content back out 
to the file (or rename the original to .bak and create 
a new version)


So the question is which part do you not understand?
- Creating a text widget
- opening the file
- copying the file to the widget
- copying changes to the file

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] creating a text widget

2011-01-13 Thread Wayne Werner
On Thu, Jan 13, 2011 at 12:02 PM, W S  wrote:

> could someone please provide me some code that would create a text widget
> that i could open a text file in?  much thanks
>

Dear Google:

Please insert all the results of "simple python GUI text editor" into my
brain. Learning is so tiresome!

Sincerely,
Wayne
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] creating a text widget

2011-01-13 Thread W S
could someone please provide me some code that would create a text widget that 
i 
could open a text file in?  much thanks



  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor