Movatterモバイル変換
[0]ホーム
problem executing python scripts in cygwin bash shell
John J. Leephrxy at csv.warwick.ac.uk
Fri Apr 6 21:25:11 EDT 2001
On 6 Apr 2001, Douglas Alan wrote:> "John J. Lee" <phrxy at csv.warwick.ac.uk> writes:>> > Aha! Good idea. Perhaps even better:>> > #!/bin/sh>> > temp = "$@ "> > //d/apps/Python20/python `cygpath -w $1` ${temp#* }>> Good idea, but not quite right. You really want:>> #!/bin/sh>> exec //d/apps/Python20/python "`cygpath -w $1`" ${1+"$@"}[...]Hmm, have you actually tried executing that?I'm no fan of shell scripting and tend to avoid it, so perhaps I'm missingsomething, but your modification of my little script doesn't appear towork (tst.py just prints out sys.argv).Your script:$ //c/Python20/Local/tst.py['c:\\Python20\\Local\\tst.py', '//c/Python20/Local/tst.py']$ //c/Python20/Local/tst.py foo bar['c:\\Python20\\Local\\tst.py', '//c/Python20/Local/tst.py', 'foo', 'bar']My script:$ //c/Python20/Local/tst.py['c:\\Python20\\Local\\tst.py']$ //c/Python20/Local/tst.py foo bar['c:\\Python20\\Local\\tst.py', 'foo', 'bar']tst.py looks like this:#!/usr/bin/env pythonimport sysprint sys.argv(did that test just as my laptop's batteries were going flat, so apologiesfor any typos)John
More information about the Python-listmailing list
[8]ページ先頭