| | |
Text entered in a grid cell should be numeric
![]() |
I'm not entirely sure what you mean by a 'grid', but if you only want to accept numeric input, you can use a function like this to return it:
As for the second part of your question, I'm not fully sure what that 'grid' is, so can you elaborate on it or show some code please? Thanks.
python Syntax (Toggle Plain Text)
def getNum(): while True: n = raw_input('Enter a number:') try: n = float(n) # or int(n) if you want an integer return n except: print 'Enter a number!'
As for the second part of your question, I'm not fully sure what that 'grid' is, so can you elaborate on it or show some code please? Thanks.
"Two good old boys in a fire-apple red convertible. Stoned. Ripped. Twisted. Good people."
- Hunter S. Thompson
my photography
- Hunter S. Thompson
my photography
•
•
•
•
Hi All,
I have created a grid and want to implement the following idea:
The user should be able to enter only numeric values in any of the cells in that grid.
I could not get any property of the cell which can check for the entered data.
Please guide as for achieving this.
Thanks,
Dinil
Try harder and you'll find it pays off in better answers
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Check out my Site | and join us on IRC | Python Specific IRC
![]() |
Similar Threads
- checking input data using checkinput() function (Visual Basic 4 / 5 / 6)
- formatting text (VB.NET)
- How to detect a click in a grid cell? (Python)
- Limit Text box input (VB.NET)
- Table width (HTML and CSS)
- Setting the focus to a specific text box and other woes (C#)
- Cursor control in text boxes: (HTML and CSS)
- refresh datagrid causes error if oper scrolled off right side of grid (VB.NET)
- How do you center the text in a JTextField?? (Java)
- chars and floats (C)
Other Threads in the Python Forum
- Previous Thread: Help needed: String to Dictionary conversion
- Next Thread: Text entered in a grid cell should be numeric
| Thread Tools | Search this Thread |
accessdenied advanced aliased argv beginner bits calling casino change command convert count csv cturtle cursor def dictionary digital dynamic dynamically enter event examples external file float format frange function google gui hints homework i/o iframe import input jaunty java keyboard lapse line linux list lists loop microphone mouse movingimageswithpygame multiple newb number numbers obexftp output parameters parsing path port prime programming projects py py2exe pygame pygtk pyopengl python random recursion remote return reverse scrolledtext session signal simple skinning sprite string strings syntax terminal text threading time tkinter tlapse tuple tutorial ubuntu unicode unit urllib urllib2 variable voip web-scrape whileloop wxpython





