choderalab / openmm

OpenMM is a toolkit for molecular simulation using high performance GPU code.
1 stars 0 forks source link

fix ValueError: I/O operation on closed file and fix TypeError: a bytes-like object is required, not 'str' #20

Open AntoniaRabe opened 4 months ago

AntoniaRabe commented 4 months ago

For me the script was not working completely without error messages, so I would suggest two changes in particular: 1) For the ValueError enclose the map() function with a list(map()) 2) For the TypeError convert strings into bytes like so: leap_script_ala3_bytes = leap_script_ala3_strin.encode('utf-8') os.write(leap_script_ala3_file[0], leap_script_ala3_bytes) anytime there is an os.write

I attached the script that worked for me. Hope it helps. amber2openmm.txt