DEV Community

taijidude
taijidude

Posted on

2 1

Run python scripts with less typing...

When you run a lot of python scripts from the linux command line there is a nice way to save some key strokes.

You have to put the following in the first line of your script. This is a called a shebang line. Although i have no idea why it has that name.

#!/usr/bin/env python
Enter fullscreen mode Exit fullscreen mode

After this you have to make the script executable.

chmod +x generate.py
Enter fullscreen mode Exit fullscreen mode

If all this is done, you can just run the script like a regular shell script.

before:

python test.py
Enter fullscreen mode Exit fullscreen mode

after:

./test.py
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more