Here is a quick PyMEL script to get a list of Maya's global variables which you can use to easily grab some data without having to run your own commands or needing to query around the interface. There are 750+ by default, and Mental Ray will add a handful as well. Many values are actually not set, or are empty by default.
from pymel.core import *
for index, eachEnv in enumerate(MelGlobals().keys()):
print "%s- %-50s %s" %(index, eachEnv, melGlobals[eachEnv])
Some nice ones to keep in mind are:
- $gMainPane
- $gMainWindow
- $panelName
There are also some humorous ones: