vk <vmi...@gmail.com> writes:

> There needs to be a "user_io" or "sanitize" module in the standard
> library to take care of this stuff.
> Like:
> 
> import userio
> 
> logic = userio.userio()
> 
> number = logic.getNumeric("blah: ") # will offer the user a "re-do" in
> case of bad input
> number = logic.forceGetNumeric("Enter your bet!: ") # even if input is
> tainted, will return some number
> 
> text = logic.getText("blargh: ") # return all text
> 
> text = logic.setValidText("[A-Za-z]")
> text = logic.forceGetText("blargh: ") # return some text, strips
> invalid chars
> 
> 
> ... but there isn't, as far as I know.

If there were, I would expect it to conform with PEP 8 (get those ugly
camelCase names outta there :-)

-- 
 \      “The face of a child can say it all, especially the mouth part |
  `\                                        of the face.” —Jack Handey |
_o__)                                                                  |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to