Python Forum

Full Version: How to Make Python code execution pause and resume to create .csv and read values.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
You need to provide a more detailed objective.
It's hard to imagine exactly what you are actually trying to do.
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()