I have a scraper which scrape one site (Written in python). While scraping the site, that  print lines which are about to write in CSV. Scraper has been written in Python and now I want to execute it via PHP code. My question is 

how can I print each line which is getting printed by python code. 

I have used exec function but it is none of my use and gives output after executing all the program. So;

Is it possible to get python output printed while it is getting executed via PHP.
I think I have a fair idea of what you are saying put I am not too sure what you mean.
If you mean to say that everytime the python script does a print, you want the php code to output what was print?
If that is the case you could pass it as a POST DATA via HTTP. That is instead of printing in Python, you could send it to the PHP Script, which on receiving the data would print it.
I am not too sure if this is what you want though.
Print Python output by PHP Code