Simple ping implementation [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I need simple ping that will return some float number or None if destination unreachable. I am using Python 3 and windows and don't want to use standart ping, cause i have to decode bytes from shell and parse results. I know nothing about implementation of ICMP protocol so ready to use library is the best choice.

You could use a pure Python implementation like the following:
https://pypi.python.org/pypi/ping
or if you prefer this one:
http://www.python.org/~jeremy/python.html
and also take a look here, because they are discussing about the subject and you may find it useful:
python non-privileged ICMP
UPDATE
Without the need of patching for Py 3, a very simple example:
https://github.com/volftomas/pyicmp

Active State Recipes is always the first place when I want to find such tiny/common/useful code snippets.
Here's one:
icmplib (Python recipe)
It works in Python3,

Related

Allen Bradley L16ER communication via Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am trying to communicate with an Allen Bradley L16ER PLC via python. What I've found online says that I should use either CPPPO or pycomm modules to accomplish this. I have looked for a good source of documentation for these, and was unable to find one. Is there a good place to find an explanation of the basics of how to use either of these? Also, is there an alternative solution that may work better?
To further define my problem, let's define understanding of using this module into three layers.
Understanding Python.
Understanding how PLCs communicate.
Understanding how to use these modules.
While I understand level 1, I don't understand level 2. This makes it very hard to understand level 3.
You can look at pylogix, it has some example code for it:
https://github.com/dmroeder/pylogix

Django sending xml requests at the same time [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Using the form i create several strings that looks like xml data. One part of this strings i need to send on several servers using urllib and another part, on soap server, then i use suds library. When i receive the respond, i need to compare all of this data and show it to user. The sum of these server is nine and quantity of servers can grow. When i make this requests successively, it takes lot of time. According to this i have a question, is there some python library that can make different requests at the same time? Thank you for answer.
You might want to consider using PycURL or Twisted. These should have the asynchronous capabilities you're looking for.

Python Networking Libraries [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've search a little bit on net about urllib library in python 2.7, due to my friend's tip and because I've already used for a while. Well, what I really wanna know is about indications. Supposing I desire to create a application that is going to be used in a specific device that communicates with another device with same application, e.g A message application, or even a virtual simple game (using only the network), what are the possible libraries I can use? If some of you've already used anything to build a similar application, please, I'll appreciate your knowledge.
It sounds like you want to develop an application specific protocol which is different than HTTP.
HTTP is carried over TCP and Python connects to TCP transports with the standard socket module. There is a small overview of the use of sockets in the Python standard documentation.
The most important part of your new protocol is ensuring each side knows when the other side has sent a complete message. This can be very simple (each message ends with a newline) to as complex as you need.

Python xmlrpc server in windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm looking for a library that can help me build a good XMLRPC server in Python that could run on Windows. The SimpleXMLRPCServer class looks fine but I don't know if it will suit all my needs, since I'd like to be able to connect from multiple clients at the same time. I found this on GitHub, but I don't know if it'll work.
Any suggestions/ideas?
I like CherryPy for XMLRPC using the built-in tool/dispatcher, and it runs on Windows as far as I know.
But you really need to ask yourself why you want to do RPC vs. a RESTful service in 2010. XMLRPC is very limited in the variable types allowed, and adds significant encapsulation overhead, and requires a client that can talk XMLRPC.
I also like CheeyPy, but have also used Twisted for such needs. Pretty simple to use and Twisted has defereds and helper functions like deferToThread and callLater to allow for blocking code to act in a non-blocking fashion.
Take a look at http://twistedmatrix.com/documents/current/web/howto/xmlrpc.html for a simple example.
I like to use circuits for stuff like this (but it's not for everyone). There's a simple example in the examples/web/ directory in the source repository.

Is there autoexpect for pexpect? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I would like to generate Python Expect (pexpect) code automatically, does something like autoexpect exist for pexpect?
I have written one:
https://github.com/ianmiell/autopexpect
which works in very basic form. Please contribute if you can!
Use it much the same way as autoexpect:
./autoexpect
[your session]
[exit session]
./script.py
As with autoexpect, you may need to fiddle with the produced script.
Not really, AFAIK, but you could use expy AKA expectpy, rather than pexpect, if you depend on autoexpect's functionality. There's nothing conceptually standing in the way of implementing a pyautoexpect -- it's just that, as far as I know, nobody's taken the trouble of doing it (since I've never felt a need for autoexpect myself, I'm not really surprised;-).

Categories

Resources