Crayon Kingdom A tech, develop and reading blog.

How to directly run a Python script in a *nix environment

Under Mac or Linux environment, add a comment line at the beginning of the file: #!/usr/bin/env python3 print('hello, world') Make the .py file executable: $ chmod a+x hello.py Then, run it by typing: $ ./hello.py You are all set! Read more
Posted at 2016-02-16 07:43:42 by Ares Ou

Search


Categories