test.py #!/usr/bin/env python # -*- coding: utf-8 -*- import sys def main(str): print(str) if __name__ == '__main__': args = sys.argv main(args[1]) str="aaa" python test.py $str aaa