I am new to python2.7, i wanted to copy file placed in different directory and write to a file placed in current directory, but i don't know how to switch between different drectories.
Asked
Active
Viewed 17 times
0
-
There is no need to switch directories. Just pass full paths to the files. This makes your code more robust, too. – tripleee Mar 14 '17 at 06:29
-
For the record here's how to switch directories: http://stackoverflow.com/questions/431684/how-do-i-cd-in-python – tripleee Mar 14 '17 at 06:29
-
i tried chdir() to get in the desired directory , copied that file and got back to my current directory by again using chdir().but in doing so i got error TypeError: an integer is required – Prashant Singh Mar 14 '17 at 06:52
-
Yeah, don't do that and things will be simpler. – tripleee Mar 14 '17 at 06:58