7
PacRat
6y

Learning the subprocess module in python, because os is deprecated. its a shame because i had just learned os

Comments
  • 2
    OS functions are wrappers of subprocess (at least in python3)
    So there is nothing wrong using them.

    But yes using subprocess directly is better.
  • 1
    @shelladdicted ah, good to know! thanks
  • 5
    os deprecated?? When? Why?
  • 1
    It's the other way around for me.

    Whenever I feel the urge to shell out to achieve something in Python I stop and think twice. I've chosen Python over scummy shell scripts for a reason, right?

    If there's really no way around it, at least do it through a semi-decent abstraction: https://amoffat.github.io/sh/
  • 1
    @karelian

    i'm looking to write up a graphical UI using python/GTK 3, to detect an art pen-tablet device, and use said UI to graphically (using subprocess to talk to X in the background) allow a user to customize the tablet region and generate a script that can be run either on startup, or when the tablet is plugged in (i know the xfce DE has settings that allow that).

    basically i need subprocess to talk to X, python's mainly the frontend
  • 1
    @gitlog maybe deprecated was the wrong word, but it's for sure being replaced eventually
    https://docs.python.org/2/library/...
Add Comment