How to speed up a .py script refering to millions of files? : <p>I have about 2.5M files to process with a .py script. </p>

<p>I'm using super calculator but I the problem is not the power, its the python process itself that open and close every time and loosing time.</p>

<p>I'm using a loop to get every files in a folder that I want to convert with the script. So the ${line} refers to a file where every line is referring to every files of the folder.</p>

<p>Is there a way to process all files after opening the .py script instead of looping the python script? </p>

<p>There is my loop code :</p>

<pre><code>### LOOP ###
while :
do
pythonsh ${RAMDISK}/script.py -l ${RAMDISK}/${line}.pdb -U '' -A hydrogens

done

exit
</code></pre>

<p>The python script is only a tool to convert .pdb to .pdbqt files that I've found from AutodockTools which comes with Autodock4.</p>
