Looking for sample python script using Tkinter

Rick Johnson rantingrickjohnson at gmail.com
Sat Jan 3 01:32:06 CET 2015


On Friday, January 2, 2015 5:03:35 PM UTC-6, access... at gmail.com wrote:
> I have a script that I trying to go from command line
> entry to interface entry. [...] I have a few requirements
> when capturing the data:
>    Must be able to navigate to a file and capture entire
>    filename and pathname (which may be on a network rather
>    than the C drive)

I don't foresee an issue here. Like Christian said, give the
tkFileDialog a spin.

>    Capture date
>
>    Capture text (Some of the data entry fields will have
>    commas)
>
>    Some of the data entry fields are required, some are
>    not.

The "capturing" part has nothing to do with GUI's, and the
code should map "almost unchanged" from your command-line 
code.

> Is there a sample script out there that I can review to
> see how these features are accomplished? I am particularly
> stumped by #1 and 4.

Maybe, but i would not know. I think instead of expecting
that a script in the wild might be a one-to-one mapping of
your current problem, you should break the many problems
within this script into distinct areas of research.  But
first you should research the following prerequisites:

  1. How to: create a blank Tkinter window?
     Hint: tk.Tk()

  2. How to: place "N" input fields on a Tkinter window?
     Hint: tk.Entry(...)

  3. How to: dynamically create "N" input fields on demand?
     Hint: "for" he's a jolly good fellow!

  4. How to: customize and/or restrict the input of an input field?
     Hint: "widget.bind("<SEQUENCE_STRING>", func)"

  5. How to: "validate" a group of input fields?
     Hint: "for" he's a jolly good fellow!

  6. How to: allow the user to locate a file (local or otherwise?)
     Hint: "import tkFileDialog"


  http://effbot.org/tkinterbook/
  http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html

I think you'll catch more informative answers if you
restrict the problem domain a bit.



More information about the Python-list mailing list