Python Forum
How to Make Python code execution pause and resume to create .csv and read values. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to Make Python code execution pause and resume to create .csv and read values. (/thread-10943.html)



How to Make Python code execution pause and resume to create .csv and read values. - Kashi - Jun-14-2018

I want to write a code which can create "mydata.csv" file, (python execution should pause here) write values into "mydata.csv", after closing "mydata.csv" python code execution should resume. Wall Wall Wall


RE: How to Make Python code execution pause and resume to create .csv and read values. - Larz60+ - Jun-14-2018

You need to provide a more detailed objective.
It's hard to imagine exactly what you are actually trying to do.


RE: How to Make Python code execution pause and resume to create .csv and read values. - DeaD_EyE - Jun-14-2018

You're describing synchronous code.

fd = open('your_file', 'w')
# code which does other stuff
# now we have new data, write it
fd.write(data)
# code
# close the file descriptor before your program exits
fd.close()