0

I am trying to do python scripting as sudo user and execute the following command, Please help me

import os

os.system ('/usr/bin/ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”')

Error:: /usr/bin/ is a directory

Thanks in advance who are all helping to give the answer and appreciated :)

  • 1
    You want someone to write a complete Python script for you that calls all these commands? Why not just create a shell script? – Gino Mempin Oct 22 '19 at 10:13
  • Actually i have a python respository which supports multiple tasks hence I have to do in python only – yashu natesh Oct 22 '19 at 17:28
  • Yes...i stuck in the middle please help me – yashu natesh Oct 22 '19 at 17:29
  • If you already have an existing code/attempt, please [edit] the post to include it. Your current post is currently [too broad](https://stackoverflow.com/help/closed-questions) because people here will not write the _entire_ code for you. If you instead posted an honest attempt and then explain which specific part of it is not working, people would then be glad to help you debug it. – Gino Mempin Oct 23 '19 at 00:19
  • Also, you can still implement it as a shell script since all the commands seem to be directly callable from a shell script (it would certainly be easier too IMHO). Then in your Python modules/scripts, just call the shell script. See [How to call a shell script from python code?](https://stackoverflow.com/q/3777301/2745495). – Gino Mempin Oct 23 '19 at 00:20
  • I have edited the code to execute the script, but I need like go to the path /usr/bin/ and execute it – yashu natesh Oct 23 '19 at 05:13
  • You have a space between `/usr/bin/` and `ruby`. There needs to be NO SPACE between, as in `/usr/bin/ruby` to run the actual `ruby` binary. – Gino Mempin Oct 23 '19 at 06:23

0 Answers0