python not recognizing new created files
<p>I have a python script that will create a text file and then will run a command on this newly created file.</p>

<p>The problem is that the command line is not recognizing the newly created file and I'm getting an error that the file is empty.</p>

<p>my code is something like this:</p>

<p><code>randomval</code> is a function that will create random characters and return them as a string.</p>

<pre><code>text_file = open("test.txt", "w")
text_file.write(randomval(20,10))


# do something with the `test.txt` file
</code></pre>

<p>but I'm getting an error that the file test.txt is empty.</p>

<p>Is there anyway to solve this?</p>
