質問

Im trying executing a python file from an alias (macosx).

It's possible?.

alias execute ='python path/file.py'

Im trying like this, but doesn't work, any suggestion?

Thanks

役に立ちましたか?

解決

Remove the space before the =, and it should work:

$ cat /tmp/x.py 
print 'hello, world!'

$ alias execute='python /tmp/x.py'
$ execute
hello, world!

Also note that I'm using the absolute path (/tmp). Using a relative path would make the command work in some directories, but not in others.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top