def get_free_space(folder):
 if (os.name == u'nt'):
  import ctypes
  free_bytes = ctypes.c_ulonglong(0)
  ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(folder), None, None, ctypes.pointer(free_bytes))
  return (free_bytes.value / (1024 * 1024))
 else:
  stats = os.statvfs(folder)
  return ((stats.f_bavail * stats.f_frsize) / (1024 * 1024))

def get_free_space ( folder ) : if ( os . name == u'nt' ) : import ctypes free_bytes = ctypes . c_ulonglong ( 0 ) ctypes . windll . kernel32 . GetDiskFreeSpaceExW ( ctypes . c_wchar_p ( folder ) , None , None , ctypes . pointer ( free_bytes ) ) return ( free_bytes . value / ( 1024 * 1024 ) ) else : stats = os . statvfs ( folder ) return ( ( stats . f_bavail * stats . f_frsize ) / ( 1024 * 1024 ) )
return folder/drive free space .