I’m trying to change the current directory from C: to Y:
I tried:
import os
os.chdir('Y:')
but I keep getting an error saying that it can’t locate the drive.
Essentially I’m looking for the equivalent of the
cd /d
command in cmd.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you sure
Y:really is a valid drive letter?Try
os.chdir('C:')and make sure that works. (It works for me.)