DEV Community

Wincent Balin
Wincent Balin

Posted on • Originally published at ofdigitalwater.postach.io on

1

Python shebang

Currently, in the interregnum where Python 2 and Python 3 may co-exist on the same system, the PEP 0394 recommendations for the shebang line in Python programs run in short like this:

  1. Use #!/usr/bin/env before Python interpreter
  2. Use #!/usr/bin/env python only for programs that work with both Python 2 and Python 3
  3. If your program runs with Python 3 only, replace python in the previous line with python3
  4. Else, for Python 2-based programs, replace python with python2

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay