Comments (8)
@malli02422, change your cap=pyshark.FileCapture('D:\mallik.cap')
line to cap=pyshark.FileCapture(r'D:\mallik.cap')
?
from pyshark.
Discussion continued in #60; closing this.
from pyshark.
Hi
still I am Getting the same thing .
import pyshark
cap=pyshark.FileCapture(r'D:\mallik.cap')
print cap[0]
C:\Python27\python.exe "D:/Trailproject/string conversion.py"
Traceback (most recent call last):
File "D:/Trailproject/string conversion.py", line 5, in
print cap[0]
File "C:\Python27\lib\site-packages\pyshark\capture\file_capture.py", line 58, in getitem
self.next()
File "C:\Python27\lib\site-packages\pyshark\capture\file_capture.py", line 48, in next
packet = self._packet_generator.send(None)
File "C:\Python27\lib\site-packages\pyshark\capture\capture.py", line 159, in _packets_from_tshark_sync
tshark_process = existing_process or self.eventloop.run_until_complete(self._get_tshark_process())
File "C:\Python27\lib\site-packages\trollius\base_events.py", line 300, in run_until_complete
return future.result()
File "C:\Python27\lib\site-packages\trollius\futures.py", line 287, in result
raise self._exception
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect
Process finished with exit code 1
from pyshark.
Can you run the command
f = open(r'D:\mallik.cap')
?
from pyshark.
I have run the command and found the following out put.
f=open(r'D:\mallik.cap')
print f
C:\Python27\python.exe "D:/Trailproject/string conversion.py"
<open file 'D:\mallik.cap', mode 'r' at 0x01CCA230>
Process finished with exit code 0
On Fri, Feb 20, 2015 at 11:00 PM, Gustavo Goretkin <[email protected]
wrote:
Can you run the command
f = open(r'D:\mallik.cap')
?
—
Reply to this email directly or view it on GitHub
#52 (comment).
Best Regard
Mallikarjuna Reddy Thathekalva
from pyshark.
I have tried this
r=file(r'D:\mallik.pcap')
while True:
line=r.readline()
if (len(line)==0):
break
line=line.rstrip('\n')
print line
r.close()
And I got following output
C:\Python27\python.exe D:/Trailproject/packetCapture.py
� M<+
Process finished with exit code 0
I am not able to use it with windows and I have verified the following code as well
import pyshark
capture=pyshark.FileCapture('D:\mallik.pcap')
print capture.len()
C:\Python27\python.exe D:/Trailproject/packetCapture.py
0
Process finished with exit code 0
The array length is Zero
will only work with Linux ?? is there is any way to use it with windows??
from pyshark.
Using \
characters in paths is going to cause a problem - use r'D:\mallik.pcap'
or 'D:/mallik.pcap'
. See here.
I think that a more appropriate venue for these questions is Stack Overflow. If you make a post there and send me the link I will help you there.
from pyshark.
Hi ,
Unfortunately This doesn't work out .
Please find the code that I have edited
import pyshark
capture=pyshark.FileCapture(r"D:\mallik.pcap")
print capture.len()
C:\Python27\python.exe D:/Trailproject/packetCapture.py
0
Process finished with exit code 0
Find the attached pcap file . I can't able o execute the very basic command
as well. I don't how I can use this library
On Mon, Mar 9, 2015 at 7:52 PM, Bo Bayles [email protected] wrote:
Using \ characters in paths is going to cause a problem - use
r'D:\mallik.pcap' or 'D:/mallik.pcap'. See here
https://pythonconquerstheuniverse.wordpress.com/2008/06/04/gotcha-%E2%80%94-backslashes-in-windows-filenames/
.I think that a more appropriate venue for these questions is Stack
Overflow. If you make a post there and send me the link I will help you
there.—
Reply to this email directly or view it on GitHub
#52 (comment).
Best Regard
Mallikarjuna Reddy Thathekalva
from pyshark.
Related Issues (20)
- data._all_fields is not working with use_ek HOT 1
- Cannot disable Thrift protocol
- No captures or accompanying errors in Ubuntu HOT 1
- Windows: no running event loop, when using pyshark.FileCapture() HOT 3
- Difference between Packet length and captured_length attributes
- Unable to access certain parts in Wi-Fi6
- Lack of proper Documentatuon HOT 2
- Getting UnknownInterfaceException in docker while tshark works
- get all dns answers from a dns packet HOT 2
- Wireshark to Neo4j for analysis
- How to utilize In-Memory Processing while live capture
- Finding protocols in base layers
- Make it possible to supply arguments to dumpcap
- Release the latest code please
- Inform the user of unsupported protocol usage
- FIFO pipe files are left open after using LiveCapture.sniff()
- duplicate keys in JSON objects are lost HOT 1
- x509af_notafter and x509af_notbefore yielding vague data
- pyshark fails to parse the tls.handshake_certificates into actual certificate data.(pyshark无法解析tls.handshake_certificates为实际证书数据) HOT 1
- Unable to retrieve duplicate layers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyshark.