[Python] run python script directly from command line

Discussão em 'Python' iniciado por Stack, Setembro 4, 2025.

  1. Stack

    Stack Membro Participativo

    #!/usr/bin/env python


    I put that at the top of a script. I've seen that should make the script runnable from the command line without the need for python programname.py. Unless I'm misunderstanding I should be able to use programname.py as long as I have the above line at the top of the script. Is this correct?

    It isn't working for me I just get an error indicating that I would have to use python at the beginning of the 'call'.

    Continue reading...

Compartilhe esta Página