0

i am trying to change the current directory but it is not working because it requires root privileges.Can anyone tell me how can i get the root privileges to change the directory( linux ).

import os
os.chdir('~/.jenkins/jobs/pip2/builds/32') 
7
  • What was the error code? Commented Mar 16, 2017 at 12:02
  • No such file or directory: '~/.jenkins/jobs/pip2/builds/32'....... but it is there Commented Mar 16, 2017 at 12:03
  • Possible duplicate of: (Check this question) change current working directory in python Commented Mar 16, 2017 at 12:03
  • \\ not working and / is working with a directory that doesnt require root privileges Commented Mar 16, 2017 at 12:09
  • Run the script as root user. Commented Mar 16, 2017 at 12:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.