[Tutor] How can I make my script work without calling Python?

D-Man dsh8290@rit.edu
Thu, 29 Mar 2001 12:31:40 -0500


On Thu, Mar 29, 2001 at 06:43:08PM +0200, Remco Gerlich wrote:
| On Thu, Mar 29, 2001 at 10:39:16AM -0500, Blake Winton wrote:
| > Because I need to tell _every_ python script I write that it's
| > actually a python script?  Surely if *nix is so great it could
| > figure that out from the ".py" extension on my files.  ;)  Or
| > at least have a way for me to only type it in once, instead of
| > in _every_ file...
| 
| Well, it's better than having a dozen programs claiming that ".doc" belongs
| to them... And I have scripts written in different versions of Python.

Good point as well.  The worst is when you use multiple versions of
Word (on different machines) and each one thinks it should be called
.doc.  Then you save with the new version and forget to specify
the old format, ...

| Anyways, there is a cool hack you can do in DOS batch files, don't know if
| it's needed in the latest Windows, but it's fun to mention. Name your Python
| file foo.bat and start it with this:
<snipped>

Nice trick!

-D