Solved

simple way to check input format

Posted on 2011-09-16
3
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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…

726 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