8 ms·
I like it, thanks for sharing. Why not a standard unix shebang line at top of index.py ?
by smichael 5y ago
I like it, thanks for sharing.
Why not a standard unix shebang line at top of index.py ?
- jstrieb 5y agoA standard shebang will work, too. But one of my (perhaps idealistic) goals was to design QuickServ so that the user need never use the command line. Part of this involves sweeping the PATH and other environment variables under the rug. Since the QuickServ syntax deviates from the standard shebang, I thought it would be important to highlight front and center in the tutorial.
- smichael 5y agoThanks for explaining. My thinking was: by (optionally?) allowing the usual extra characters (#!python3 -> #!/usr/bin/env python3) it remains standard, avoiding an unnecessary roadblock for existing scripts and programmer workflows. PS: I also like your shorter syntax and would be happy if it became a cross platform standard - Shebang 2.0..
- jstrieb 5y agoSorry if it wasn't clear from the previous comment, but the version with the usual extra characters will work, too. Scripts with the standard shebang will still be understood by QuickServ. So having a QuickServ script start with #!/usr/bin/env python3 should be completely valid as far as I have tested. It's just that QuickServ doesn't require the absolute path. Another, more subtle difference is that QuickServ actually shlexes the shebang into arguments. On Linux, on the other hand, the remainder of the shebang string after the path to the executable is passed as a single argument. http://mail-index.netbsd.org/netbsd-users/2008/11/09/msg002388.html http://mail-index.netbsd.org/netbsd-users/2008/11/09/msg0023... https://github.com/jstrieb/quickserv/commit/3027a8e91abf4a574c5681204f03d239e9a42c21 https://github.com/jstrieb/quickserv/commit/3027a8e91abf4a57...