Link to home
Start Free TrialLog in
Avatar of dodgerfan
dodgerfanFlag for United States of America

asked on

Get IP addres information from field

I am very new to Python. I am inserting data into a postgresql database. One field is an IP address with port (i.e., 00.00.00.00:00). I need to take the IP address and pit it in one database field then take the port and put it in another database field. The IP addresses can be either ipv4 or ipv6, and I need to handle it the same way regardless of whether it is ipv4 or ipv6. How can I get this working properly? Any help is appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry I noticed that when I originally posted my answer I had forgotten to put the port number in my example. I have now updated it.
Avatar of dodgerfan

ASKER

Thank you for the help. That works.