Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

[BCVTB, PyhtonActor] external file read and write issue

I am attempting to read (and/or) write onto external text file in the fired PythonActor.py function. When I use the 'with' keyword, there seems to be an error. (the below mwthod is synchronous, thus more preferable)

with open('Path/to/file', 'r') as content_file:
    content = content_file.read()

But when I use the conventional methods (not the latest, though), it is working properly. But since this method is asynchronous, the method is not coherent & not (always) sequential

content_file = open(file_path,'r')
f.write(data)
f.close()

Any guidance would be helpful!

[BCVTB, PyhtonActor] external file read and write issue

I am attempting to read (and/or) write onto external text file in the fired PythonActor.py function. When I use the 'with' keyword, there seems to be an error. (the below mwthod method is synchronous, thus more preferable)

with open('Path/to/file', 'r') as content_file:
    content = content_file.read()

But when I use the conventional methods (not the latest, though), it is working properly. But since this method is asynchronous, the method is not coherent & not (always) sequential

content_file = open(file_path,'r')
f.write(data)
f.close()

Any guidance would be helpful!

[BCVTB, PyhtonActor] external file read and write issue

I am attempting to read (and/or) write onto external text file in the fired PythonActor.py function. When I use the 'with' keyword, there seems to be an error. (the below method is synchronous, thus more preferable)

with open('Path/to/file', 'r') as content_file:
    content = content_file.read()

But when I use the conventional methods (not the latest, though), it is working properly. But since this method is asynchronous, the method is not coherent & not (always) sequential

content_file = open(file_path,'r')
f.write(data)
f.close()

Any guidance would be helpful!helpful!! This is a part of my model:

image description

[BCVTB, PyhtonActor] external file read and write issue

I am attempting to read (and/or) write onto external text file in the fired PythonActor.py function. When I use the 'with' keyword, there seems to be an error. (the below method is synchronous, thus more preferable)

with open('Path/to/file', 'r') as content_file:
    content = content_file.read()

But when I use the conventional methods (not the latest, though), it is working properly. But since this method is asynchronous, the method is not coherent & not (always) sequential

content_file = open(file_path,'r')
f.write(data)
f.close()

Any guidance would be helpful!! This is a part of my model:

image description