I tried to cat a file, using Popen(), right after creating and writing to it. It doesn\'t work. Print p gives two empty tuples (\'\',\'\'). Why ? I\'ve used rename to ensure an
You did not call close. Use fd.close() (you forgot the parentheses there to make it an actual function call). This could have been prevented by using the with-statement:
with open("__q", "w") as fd:
fd.write(t)
# will automatically be closed here