forked from kahramankostas/IoTDevIDv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBULUR.py
74 lines (42 loc) · 1.02 KB
/
BULUR.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
# coding: utf-8
# # automates the tshark filter rules within a CSV file using python.
# In[1]:
import os
import pandas as pd
# In[3]:
import os
def find_the_way(path,file_format):
files_add = []
# r=root, d=directories, f = files
for r, d, f in os.walk(path):
for file in f:
if file_format in file:
files_add.append(os.path.join(r, file))
return files_add
files_add=find_the_way('./','.ipynb')
files_add
# In[4]:
from tqdm import tqdm
# In[6]:
ara1="KF"
for i in (files_add):
try:
with open(i, "r", encoding="utf8") as file:
line=file.read()
if ara1 in line:
print(i)
except:pass
files_add=find_the_way('./','.py')
files_add
# In[4]:
from tqdm import tqdm
# In[6]:
ara1="tshark"
for i in (files_add):
try:
with open(i, "r", encoding="utf8") as file:
line=file.read()
if ara1 in line:
print(i)
except:pass