Solved

simple way to check input format

Posted on 2011-09-16
3
256 Views
Last Modified: 2012-05-12
is there a simple way to check input format... im using wxpython and collecting data in wxTextctrl... meaning I have to have people input an ip address... I 'm wondering if I can check that it is  at least in the correct  format
ie xxx.xx.xx.xxx ....
0
Comment
Question by:dolamitejenkins
3 Comments
 
LVL 5

Accepted Solution

by:
speak2ab earned 500 total points
ID: 36553001
A similar question has been discussed on this forum:
http://stackoverflow.com/questions/319279/how-to-validate-ip-address-in-python

The info there should put you on the right track.

0
 
LVL 29

Expert Comment

by:pepr
ID: 36553391
I absolutely agree with speak2ab (he should get the points). The reason is that the socket is the standard module. It it implemented in binary (you will hardly reach that efficiency in Python), it is ready to be used, it is based on the related RFC's (i.e. standards), it may check the IP the way that you even do not know that it should be checked so (you can check easily in Python that they are 4 integer of a limited range separated by dots, but it may not be enough), it supports IPv6 that may be important for you after a while.  And it is likely that you may need its other functionality anyway.
0
 

Author Closing Comment

by:dolamitejenkins
ID: 36578402
thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Variable is a place holder or reserved memory locations to store any value. Which means whenever we create a variable, indirectly we are reserving some space in the memory. The interpreter assigns or allocates some space in the memory based on the d…
This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question