Embed bash in python

后端 未结 9 1328
别那么骄傲
别那么骄傲 2020-12-25 13:43

I am writting a Python script and I am running out of time. I need to do some things that I know pretty well in bash, so I just wonder how can I embed some bash lines into a

9条回答
  •  没有蜡笔的小新
    2020-12-25 14:02

    As aforementioned, you could use os.system(); it's quick and dirty, bu it's easy to use and works for most cases. It's literally a mapping on to the C system() function.

    http://docs.python.org/2/library/os.html#os.system

    http://www.cplusplus.com/reference/cstdlib/system/

提交回复
热议问题