python - Change multiple files of same extensions
<p>I am running a script that would change the contents inside a file with extension hgx.</p>

<p>E.g. test.hgx</p>

<p>Now, I have multiple files with extension hgx and I would like to run this same script for all the files (with extension hgx).</p>

<p>My current script looks like:</p>

<pre><code>file_name = "test.hgx"

x = open(file_name,'r')
....(and so on)
</code></pre>

<p>Is it possible to use something like:  </p>

<pre><code>file_name = "*.hgx"

x = open(file_name,'r')
....
</code></pre>

<p>So that the script runs for all the files with extension hgx. Any workaround or method to do this?</p>
