With a caution from Federico Ramponi βYou must use scapy as an interpreter yourself, not as a library,β I want to answer the non-scapy-specific parts of the question.
Q: when installing Python libraries, do I need to change my path or something similar?
A: I think you are talking about changing PYTHONPATH on a system scale. Usually this is not required or a good idea.
Third-party Python libraries must either be installed in system directories, for example, /usr/lib/python2.5/site-packages , or installed locally, in which case you may need to install PYTHONPATH in the Makefile or in the shell of the driver script.
Q: Also, is there something I can run in the interpreter to tell me the contents of the scapy package?
A: You can do something like this:
>>> import scapy >>> dir(scapy)
Or even better:
>>> import scapy >>> help(scapy)
Bonus question asked in comments.
Q: Is "import scapy" the same as "from scapy import"?
A: import scapy associates the scapy name in the local namespace with the scapy module object. OTOH, from scapy import * does not bind the module name, but all public names defined in the scapy module are connected in the local namespace.
See paragraphs 6 and 7 of the Python Reference, 6.12 Import operation .
ddaa
source share