Python doesn't print with import scapy
Question: When I enter this code:

    
    
    print "hhhh"
    from scapy.all import sniff
    print "bbbb"
    

this is the output:

    
    
    C:\Python27\python.exe C:/Users/Tamir/PycharmProjects/SIP/main.py
    hhhh
    WARNING: No route found for IPv6 destination :: (no default route?)
    
    Process finished with exit code 0
    

Why doesn't the second print (of "bbbb") work? When I put the import line in a
comment, or import another library, it works.


Answer: **sys.stdout** is redirected to readline console. It seems not working well
with pycharm in this way. Please check: "PYTONPATH\Lib\site-
packages\scapy\arch\windows__init__.py"

[![scapy\\arch\\windows__init__.py](http://i.stack.imgur.com/Anzuo.png)](http://i.stack.imgur.com/Anzuo.png)

**temporary solution** : redirect stdout to the original one

try this:

    
    
    import sys
    print "hhhh"
    orig_stdout = sys.stdout
    from scapy.all import sniff
    sys.stdout =  orig_stdout
    print "bbbb"
    

