Skip to content

Commit

Permalink
Fix Windows issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thejackal360 authored and Kreijstal committed Jan 12, 2025
1 parent f83505e commit b33df85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions PySpice/Spice/OpenSPICE/OpenSPICE.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
def run(input_fname, output_fname):
with open(input_fname, "r") as f:
file_txt = f.read()
file_txt = file_txt.replace("\n\n", "\n")
pdata = parse(file_txt)
eqns = gen_eqns_top(pdata)
# TODO Support multiple test types?
Expand Down
4 changes: 2 additions & 2 deletions PySpice/Spice/OpenSPICE/genout.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def gen_out_txt(raw_fname, title, test_type, soln, sorted_nodes):
(test_type == "tran")+i,"V({})".format(v)) \
for i,v in enumerate(sorted_nodes)])
spice_raw_file_txt += "Binary:\n"
with open(raw_fname, "w") as spice_raw_file:
spice_raw_file.write(spice_raw_file_txt)
with open(raw_fname, "wb") as spice_raw_file:
spice_raw_file.write(bytes(spice_raw_file_txt, "UTF-8"))
with open(raw_fname, "ab") as spice_raw_file:
[spice_raw_file.write(array('d', s).tobytes()) for s in soln]

0 comments on commit b33df85

Please sign in to comment.