File extension

Anil Kumar anilkum.tech at gmail.com
Fri Mar 16 23:59:09 CET 2007


Hi,

Can Python Script can have different extensions like .sh etc.... Or Is .py
is mandatory to be present as the extension for the Python Script.

We have an application where the script was initially written in shell
script with extension .sh. Now we are migrating this script to be run in
both Unix and Windows, so using Python for migration.

I have created a new Python Script porting all the changes in shell script
and it is working fine in Unix/Linux operating system. Later I changed the
extension of the file from .py to .sh, even then it worked.

But when I try a python script with extension .sh in windows, the file is
not getting recognized by the Python interpreter. Is this supported? Or is
there any way we can achieve the same?

The reason I am trying to change the extension is, it reduces lot of porting
changes. No need to go to each of our file which were referencing .sh file
before and change it to .py.

Any Help would be greatly Appreciated.

Thanks & Regards,
Anil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070316/bb51cc65/attachment.html>


More information about the Python-list mailing list