Skip to content

Commit

Permalink
PInBench: Added Python 3 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristndev committed Jan 24, 2021
1 parent a62b1b8 commit c0150a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions 3_PInBench/PInBench.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def main_wrapper(self):
logging.info("Initialising output files: [%s] and [%s].", log_file, csv_file)

# Create output csv (with times, probabilities, ...)
output = open(csv_file, 'wb')
output = open(csv_file, 'w')
writer = csv.DictWriter(output, dialect='excel', fieldnames=self.csv_cols, lineterminator='\n', delimiter=",")
writer.writeheader()

# Create output log (for file overview)
self.ov_file = open(overview_file, 'wb')
self.ov_file = open(overview_file, 'w')

# -- 2. Find model files and iterate over them
files = self.find_files_in_dir()
Expand Down Expand Up @@ -1340,6 +1340,8 @@ def run(cmd):
try:
timer.start()
stdout, stderr = proc.communicate()
stdout = stdout.decode('UTF-8')
stderr = stderr.decode('UTF-8')
finally:
timer.cancel()

Expand Down
2 changes: 1 addition & 1 deletion 3_PInBench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following frameworks are supported. Please note, that for licensing reasons
## Operating the script

The script was written using *Python 2.7*.
The script should work in both Python 2.* and Python 3.*.
It can be executed using a terminal, i.e. with `python PInBench.py`.
Help can be displayed using the extra argument `-h`:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The following frameworks are supported. Please note, that for licensing reasons
#### Usage

The script requires *Python 2.7*. It can be executed using a terminal, i.e. with `python PInBench.py`.
The script should work in both *Python 2.\** and *Python 3.\**. It can be executed using a terminal, i.e. with `python PInBench.py`.
Help can be displayed using the extra argument `-h`:

```
Expand Down

0 comments on commit c0150a6

Please sign in to comment.