# glib Constants

the built-in constants of the glib module

## Synopsis

## Description

### Glib IO Condition Constants

The IO Condition constants are a set of bit-flags that specify a condition to watch for on an event source.

`glib.IO_IN`

  There is data to read

`glib.IO_OUT`

  Data can be written (without blocking).

`glib.IO_PRI`

  There is urgent data to read.

`glib.IO_ERR`

  Error condition.

`glib.IO_HUP`

  Hung up (the connection has been broken, usually for pipes and sockets).

`glib.IO_NVAL`

  Invalid request. The file descriptor is not open.

### Glib Priority Constants

The Priority constants specify

`glib.PRIORITY_HIGH`

  Use this for high priority event sources.

`glib.PRIORITY_DEFAULT`

  Use this for default priority event sources. This priority is used when adding timeout functions with the `glib.timeout_add`() function. This priority is also used for events from the X server.

`glib.PRIORITY_HIGH_IDLE`

  Use this for high priority idle functions. For example, glib.PRIORITY_HIGH_IDLE + 10 is used for resizing operations; and, glib.PRIORITY_HIGH_IDLE + 20, for redrawing operations. (This is done to ensure that any pending resizes are processed before any pending redraws, so that widgets are not redrawn twice unnecessarily.)

`glib.PRIORITY_DEFAULT_IDLE`

  Use this for default priority idle functions. This priority is used when adding idle functions with the `glib.idle_add`() function.

`glib.PRIORITY_LOW`

  Use this for very low priority background tasks.

### Glib Spawn Flag Constants

The Spawn Flag constants are a set of bit-flags that can be passed to the `glib.spawn_async`() function.

`glib.SPAWN_LEAVE_DESCRIPTORS_OPEN`

  the parent's open file descriptors will be inherited by the child; otherwise all descriptors except stdin/stdout/stderr will be closed before calling `exec`() in the child.

`glib.SPAWN_DO_NOT_REAP_CHILD`

  the child will not be automatically reaped; you must call `waitpid`() or handle `SIGCHLD` yourself, or the child will become a zombie.

`glib.SPAWN_SEARCH_PATH`

  `argv`[0] need not be an absolute path, it will be looked for in the user's `PATH`.

`glib.SPAWN_STDOUT_TO_DEV_NULL`

  the child's standard output will be discarded, instead of going to the same location as the parent's standard output.

`glib.SPAWN_STDERR_TO_DEV_NULL`

  the child's standard error will be discarded.

`glib.SPAWN_CHILD_INHERITS_STDIN`

  the child will inherit the parent's standard input (by default, the child's standard input is attached to /dev/null).

`glib.SPAWN_FILE_AND_ARGV_ZERO`

  the first element of `argv` is the file to execute, while the remaining elements are the actual argument vector to pass to the file. Normally `glib.spawn_async`() uses `argv`[0] as the file to execute, and passes all of `argv` to the child.

### Glib User Directory Constants

The User Directory constants are integer values that are currently used only as arguments to `glib.get_user_special_dir`() function. See function documentation for details.

`glib.USER_DIRECTORY_DESKTOP`

  the user's Desktop directory

`glib.USER_DIRECTORY_DOCUMENTS`

  the user's Documents directory

`glib.USER_DIRECTORY_DOWNLOAD`

  the user's Downloads directory

`glib.USER_DIRECTORY_MUSIC`

  the user's Music directory

`glib.USER_DIRECTORY_PICTURES`

  the user's Pictures directory

`glib.USER_DIRECTORY_PUBLIC_SHARE`

  the user's shared directory

`glib.USER_DIRECTORY_TEMPLATES`

  the user's Templates directory

`glib.USER_DIRECTORY_VIDEOS`

  the user's Movies directory

### Glib Version Constants

The Version constants specify the version of `Glib` used by PyGObject as a 3-tuple containing the major, minor and patch release numbers.

`glib.glib_version`

  A 3-tuple containing (major, minor, patch) release numbers of glib.

`glib.pyglib_version`

  A 3-tuple containing (major, minor, patch) release numbers of the python bindings.