-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiles.py
More file actions
28 lines (24 loc) · 1006 Bytes
/
Copy pathfiles.py
File metadata and controls
28 lines (24 loc) · 1006 Bytes
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
## File manager/writer/reader
import os
def createFile(file_name, directory):
# This function creates the results file for each test with the specified file name and directory
print("\nCreating Results File\n")
try:
os.chdir(r'' + directory)
except:
os.mkdir(r'' + directory)
os.chdir(r'' + directory)
ResultsFile = open(file_name, 'w')
ResultsFile.write(
'Angle, Attenuation, Channel, Bandwidth (MHz), Receiving (Mbits/sec), Sending (Mbits/sec), Average RSSI (dBm), MCS (Receiving), '
'STF (Receiving) ,NSS (Receiving), MCS (Sending), STF (Sending), NSS (Sending)' + '\n')
ResultsFile.close()
def writeToFile(line, file_name, directory):
os.chdir(r'' + directory)
File = open(file_name, 'a')
File.write(line)
File.close()
def printResults(results):
print("Results:")
for cat, result in results.items():
print("{} ({}) ({}) ({})".format(cat, result[0], result[1], result[2]))