0

I have python 2.7 installed. I installed pip install py2-ipaddress. Ran the following in powershell. The issue is No Output

import ipaddress
def ipEntered():
    while True:
        try:
            val = input("Please enter the ip address of the server you wish to connect with:")
            return ipaddress.ip_address(val)
        except ValueError:
            print("Not a valid IP address")
1
  • That script indeed does not produce any output. Did you mean to call ipEntered()? Commented Jan 22, 2018 at 20:33

1 Answer 1

1


The program runs fine. Can you share the example on which it is failing ? I used the following code to test it out.

import ipaddress
def ipEntered():
        while True:
                try:
                        val = raw_input()
                        return ipaddress.ip_address(val)
                except ValueError:
                        print ("Invalid")

print ipEntered()
Sign up to request clarification or add additional context in comments.

2 Comments

See image: ibb.co/daKi1w . With the code above, nothing happens when I execute it.
You have to provide input. Try providing input like 127.0.0.1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.