O'Reilly logo

Python Programming On Win32 by Mark Hammond, Andy Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Process Parameters

These functions and data items provide information and operate on the current process and user:

chdir( path )

Changes the current working directory to path. Availability: Macintosh, Unix, Windows.

environ

A mapping representing the string environment. For example, environ['HOME'] is the pathname of your home directory, equivalent to getenv("HOME") in C.

If the platform supports the putenv() function, this mapping can modify the environment as well as query the environment. putenv() is called automatically when the mapping is modified.

If putenv() isn’t provided, this mapping can be passed to the appropriate process-creation functions to cause child processes to use a modified environment.

getcwd()

Returns a string representing the current working directory. Availability: Macintosh, Unix, Windows.

getegid()

Returns the current process’s effective group ID. Availability: Unix.

geteuid()

Returns the current process’s effective user ID. Availability: Unix.

getgid()

Returns the current process’s group ID. Availability: Unix.

getpgrp()

Returns the current process’s group ID. Availability: Unix.

getpid()

Returns the current process ID. Availability: Unix, Windows.

getppid()

Returns the parent’s process ID. Availability: Unix.

getuid()

Returns the current process’s user ID. Availability: Unix.

putenv( varname, value )

Sets the environment variable, varname, to the string value. Such changes to the environment affect subprocesses started with os.system(), popen(), or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required