How to check whether a file exists or not without exceptions in python ?

It is easy to check whether a file exists or not without exceptions in python ,python has a familiar os.path module using this module you can run isfile ,if it return True means a file exists or if it is False means file not exists

Code to check whether a file exists or not without exceptions in python


import os.path
os.path.isfile(FILE_PATH)


e.g 

>>> os.path.isfile("/home/index.html")
True
>>> os.path.isfile("/home/index_new.html")
False

In python how to Find the index of an item in a list

Here we are going to elaborate In python how to Find the index of an item in a list,Suppose i have a list [“Red”, “blue”, “green”, “orange”] , How to find out  in the color list what is the position or key of “green”


 
           array1 = ["Red", "blue", "green", "orange"]

           print array1.index("green")      
           
           Output 
              
               2   


localhost/phpinfo.php

localhost/phpinfo.php is default PHP info path, phpinfo.php is actually a aa file most of the developer used to find out the complete information about the PHP like version what are the library enabled in PHP. Also it help you to find out the root path,Configuration apc, calendar info ,cgi-fcgi ,curl info, date lib info , PHP Variables etc

Here is the phpinfo.php file code

<?php

phpinfo();

?>

Demo localhost/phpinfo.php display

localhost/phpinfo.php