Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with examples on a mac - I incorrectly attached this issue to the Raspberry Pi issue - Please ignore that one #5

Open
JL1946 opened this issue Nov 19, 2017 · 0 comments

Comments

@JL1946
Copy link

JL1946 commented Nov 19, 2017

I am getting the following error while using iPython (Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08)) in a terminal window on a mac running Sierra and implementing the following example:

For convenience, we also allow you to index the dictionary with the special value 'default', which returns a dictionary mapping address families to the default gateway in each case. Thus you can get the default IPv4 gateway with

gws = netifaces.gateways()
gws['default'][netifaces.AF_INET]
('10.0.1.1', 'en0')


The results from this test - I tried replacing "[]" with "()" in different combinations but get errors as follows:

In [15]: gws=netifaces.gateways
In [16]: gws['default'][netifaces.AF_INET]

TypeError Traceback (most recent call last)
in ()
----> 1 gws['default'][netifaces.AF_INET]

TypeError: 'builtin_function_or_method' object is not subscriptable

In [17]: gws['default'][netifaces.AF_INET]

TypeError Traceback (most recent call last)
in ()
----> 1 gws['default'][netifaces.AF_INET]

TypeError: 'builtin_function_or_method' object is not subscriptable

In [18]: gws('default')[netifaces.AF_INET]

TypeError Traceback (most recent call last)
in ()
----> 1 gws('default')[netifaces.AF_INET]

TypeError: gateways() takes no arguments (1 given)

In [19]: gws'default'

TypeError Traceback (most recent call last)
in ()
----> 1 gws'default'

TypeError: 'builtin_function_or_method' object is not subscriptable

In [20]: gws('default')(netifaces.AF_INET)

TypeError Traceback (most recent call last)
in ()
----> 1 gws('default')(netifaces.AF_INET)

TypeError: gateways() takes no arguments (1 given)

Is there a solution to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant