Providing Default Value for User Input

Miki Tebeka miki.tebeka at zoran.com
Sun Jan 11 08:56:18 CET 2004


Hello, 
> I have just begun learning Python so that I can write a simple script
> to make modification of a file used by another Python script easier.
> This file is basically a list of regular expressions. What I want to
> do is allow the user to select one of these regular expressions to
> modify, but I've realized I know of no way to provide a default value
> for user input. 
Which user input? raw_input, Tkinter, wxPython ...

> I could choose to show the regular expression the user
> has chosen and simply allow the user to retype it and modify it from
> there, but that is time consuming and error prone. Does Python support
> a way to do this? 
To do what? I don't understand your question. Maybe an example will
help.

> If worse comes to worst, is there a way I could
> write such code on my own without having to write a C-based module
> (I'd like to stick to Python code only since some users will be
> running this script on Windows without a C compiler)?
If you create a C extension you can distribute just the binary so your
users won't need a C compiler. (They might need some required DLL's
but you can ship them as well).

HTH.
Miki



More information about the Python-list mailing list