I have created a compiled python file. When I am executing the file using python command, then it is working fine like below. 
$ python file.pyc 
But, when I am putting ./ before the filename (file.pyc) like running a .sh file, then it is not working.It is throwing error.
$ ./file.pyc
It is having all the privileges (777). 
Is there any way to execute the test.pyc file like we do with a test.sh file?
Regards,
Sayantan
Is there a specific reason you're using the .pyc file? Normally, you'd just add a shebang  to the top of your script like so: #!/usr/bin/env python, modify permissions (777 is not necessary, 755 or even 744 would work), and run it $ ./file.py
How can i run a compiled python file like a shell script in Unix?