Os Fchdir
# Python2.x Python os.fchdir() Method
[ Python OS File/Directory Methods](#)
* * *
### Overview
The os.fchdir() method changes the current working directory via a file descriptor.
Available on Unix, Windows.
### Syntax
The syntax format of the **fchdir()** method is as follows:
os.fchdir(fd);
### Parameters
* **fd** -- File descriptor
### Return Value
This method does not return a value.
### Example
The following example demonstrates the use of the fchdir() method:
#!/usr/bin/python# -*- coding: UTF-8 -*-import os, sys # First, go to the directory "/var/www/html" os.chdir("/var/www/html" )# Print the current directory "The current working directory is : %s" % os.getcwd()# Open a new directory "/
YouTip