Solved

simple way to check input format

Posted on 2011-09-16
3
255 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 28

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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 while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now