Using apache web hosting I launched my first web app today and I noticed that if I put examply.com/example.py in my web browser I can see my python source code with my sql password in it. 
How do I prevent this?
Chown your python file with 640 will give a FORBIDDEN in the browser but the server will be able to execute it in PHP for example:
$output = shell_exec("python python-test.py");
echo ($output);
How to hide serverside python file from web browser?