pirate / mesh-networking

:globe_with_meridians: LEGO blocks for networking, a Python library to help create and test flexible network topologies across real and simulated physical links.
MIT License
360 stars 62 forks source link

fmt() function in multinode.py #5

Closed zlgunn closed 9 years ago

zlgunn commented 9 years ago
def fmt(type, value, fallback=None):
    try:
        return type(value)
    except Exception:
        return fallback

When called here num_nodes = fmt(int, input("How many nodes do you want? (26):"), 26) I get "Unexpected EOF when parsing" error. I found that changing input() to raw_input() fixes this in lines 54,55,56 of multinode.py. Update: changed all instances of input() to raw_input() as the former seems to cause issues.

pirate commented 9 years ago

This is a Python 3 vs Python 2 change http://stackoverflow.com/questions/10885537/raw-input-has-been-eliminated-from-python-3-2