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

Error on running very basic Ping command #81

Open
jamiabailey opened this issue Mar 26, 2024 · 1 comment
Open

Error on running very basic Ping command #81

jamiabailey opened this issue Mar 26, 2024 · 1 comment

Comments

@jamiabailey
Copy link

jamiabailey commented Mar 26, 2024

Just using the basic ping example posted here: https://pypi.org/project/icmplib/

I get the error "ping() got an unexpected keyword argument 'count'"

I am running Python version 3.9 within Visual Studio Community within a Flask App.

The exact code that will not function:
hostname = "8.8.8.8"
host = ping('8.8.8.8', count=10, interval=0.2)
if host.is_alive == True:
color = "green"
pingresult = hostname + " is up"
else:
color = "red"
pingresult = hostname + " is down"

Not sure what the deal is. Documentation states it should work with Python 3.7+ and the app I am testing with is very very basic use of this. Multiping works fine.

@ValentinBELYN
Copy link
Owner

Hi,

The count parameter of the ping function has existed since the very first version of the library. It is therefore not normal that this does not work.

Can you check that you have not declared a ping function in your code or that you have not imported a ping function from another library?

Furthermore, can you run the following code and send me the result:

import pydoc
print(pydoc.render_doc(ping))

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

2 participants