Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe because it's a hack because to get around the following not working?

#!python



Bad idea. Which python (or program named "python") will run your script?


The first python in your path would run the script.


So, if your PATH gets changed, say, by something that just lept out of your web browser's sandbox, that's the python that'll run your your scripts, right?


Yes, that's how it would work, same as with env.


Yes; #!python should be made to work.

Not to use the user's PATH, but some system ordained python (via some kernel work).

env is a hack.


> via some kernel work

Kernels shouldn't be aware of the search path shells use.


I agree, as evidenced by the bit you didn't quote. (?!)


He may be referring to binfmt.


I wasn't referring to implementation really, but the principle. The main python could be in /bin or /usr/bin or possibly /usr/local/bin. The poor user or developer shouldn't be required to anticipate where and should not need to resort to hacks such as env.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: