Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

RIght now, I type "python" to run it.

How can I type "py" to run it? Or better, do this ./

Any tips?

share|improve this question

You can add this as the first line of your python script:

#!/usr/bin/env python

Which will allow you to run your script as:


But you must make sure you make your python script executable:

chmod +x
share|improve this answer
And if you want to skip adding the ./ place the script somewhere in your path. For extra points rename the file and skip adding the .py extension. – Zoredache Jun 22 '10 at 23:21
alias py='python'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.