wcUsersData

Script to get users logged into the system.

Saves the output of users as the hostname of the system. Convert to a dict and json object, merging with other hostname output.

Runs script every min and if user is found then - time from their account

File with, usernames, time remaining on user.

time file is a json object. {'username' : 'wcmckee', 'time' : 320 }

time is amount of time left on account.

script to check this object and if 0 - lock account. ELSE, allow login.

Script to add time to acoun,, auto add time to certain groups/user a day.

username 45


In [5]:
import os
import socket
import json

In [6]:
usertimedict = dict()

In [7]:
lisho = os.listdir('/home')

In [8]:
for ish in lisho:
    usertimedict.update({ish : 0})

In [9]:
usertimedict


Out[9]:
{'blag': 0,
 'blah': 0,
 'charle': 0,
 'checkthis': 0,
 'clittle': 0,
 'figlet': 0,
 'gerty': 0,
 'jblog': 0,
 'jchick': 0,
 'joecheck': 0,
 'joeman': 0,
 'joemanz': 0,
 'pjohns': 0,
 'poi': 0,
 'point': 0,
 'poiu': 0,
 'pytest': 0,
 'qwe': 0,
 'red': 0,
 'signinlca.py': 0,
 'sjohns': 0,
 'ssung': 0,
 'tnow': 0,
 'wblack': 0,
 'wcm': 0,
 'wcmckee': 0,
 'webmck': 0,
 'wez': 0,
 'wkee': 0,
 'wmen': 0}

In [10]:
addtime = (raw_input('add how much time: '))


add how much time: 15

In [11]:
#letim = len(addtime)

In [12]:
#letim

In [13]:
addtime


Out[13]:
'15'

In [14]:
type(addtime)


Out[14]:
str

In [15]:
intime = int(addtime)

In [16]:
for ish in lisho:
    usertimedict.update({ish : intime})

In [17]:
usertimedict


Out[17]:
{'blag': 15,
 'blah': 15,
 'charle': 15,
 'checkthis': 15,
 'clittle': 15,
 'figlet': 15,
 'gerty': 15,
 'jblog': 15,
 'jchick': 15,
 'joecheck': 15,
 'joeman': 15,
 'joemanz': 15,
 'pjohns': 15,
 'poi': 15,
 'point': 15,
 'poiu': 15,
 'pytest': 15,
 'qwe': 15,
 'red': 15,
 'signinlca.py': 15,
 'sjohns': 15,
 'ssung': 15,
 'tnow': 15,
 'wblack': 15,
 'wcm': 15,
 'wcmckee': 15,
 'webmck': 15,
 'wez': 15,
 'wkee': 15,
 'wmen': 15}

In [19]:
myhn = socket.gethostname()

In [37]:
#Edit just one person

edione = raw_input('Which user to edit time: ')
timedi = raw_input('How much time to add: ')

usertimedict.update({edione : timedi})


Which user to edit time: point
How much time to add: 100

In [20]:
jstim = json.dumps(usertimedict)

In [21]:
jstim


Out[21]:
'{"wcmckee": 15, "joemanz": 15, "point": 15, "qwe": 15, "wkee": 15, "checkthis": 15, "poiu": 15, "blah": 15, "charle": 15, "poi": 15, "tnow": 15, "clittle": 15, "wblack": 15, "ssung": 15, "wmen": 15, "blag": 15, "signinlca.py": 15, "sjohns": 15, "gerty": 15, "webmck": 15, "joeman": 15, "joecheck": 15, "jchick": 15, "pytest": 15, "jblog": 15, "pjohns": 15, "wez": 15, "figlet": 15, "wcm": 15, "red": 15}'

opus = open('/home/wcmckee/sellcoffee/hostnames/' + myhn, 'w')

opus.write(jstim) opus.close()


In [26]:
rdopuw = open('/home/wcmckee/sellcoffee/hostnames/localhost', 'r')

print rdopuw.read()


{"wcmckee": 15, "joemanz": 15, "point": 15, "qwe": 15, "wkee": 15, "checkthis": 15, "poiu": 15, "blah": 15, "charle": 15, "poi": 15, "tnow": 15, "clittle": 15, "wblack": 15, "ssung": 15, "wmen": 15, "blag": 15, "signinlca.py": 15, "sjohns": 15, "gerty": 15, "webmck": 15, "joeman": 15, "joecheck": 15, "jchick": 15, "pytest": 15, "jblog": 15, "pjohns": 15, "wez": 15, "figlet": 15, "wcm": 15, "red": 15}

In [33]:
edione


Out[33]:
'point'

In [34]:
limedi = int(timedi)

In [35]:
limedi


Out[35]:
15

In [9]:
osscm = ('users > ' + myhn + '.txt')

In [11]:
osscm


Out[11]:
'users > naplesyellow.txt'

In [ ]:


In [ ]:


In [12]:
os.chdir('/home/wcmckee/sellcoffee/')

In [13]:
os.system(osscm)


Out[13]:
0

In [14]:
ophos = open('/home/wcmckee/sellcoffee/' + myhn + '.txt')

In [15]:
print ophos.read()


Out[15]:
'noby wcmckee wcmckee wcmckee wcmckee wcmckee\n'

In [17]:
ophos.close()

In [38]:
import sys

In [42]:
sys.modules.keys()


Out[42]:
['IPython.config.re',
 'IPython.core.error',
 'curses.sys',
 'zmq.sugar.weakref',
 'IPython.kernel.connect',
 'ctypes.os',
 'pexpect.select',
 'runpy',
 'gc',
 'pty',
 'IPython.utils.pprint',
 'logging.weakref',
 'pprint',
 'IPython.kernel.inprocess.zmq',
 'IPython.kernel.blocking.client',
 'IPython.kernel.comm.uuid',
 'zmq',
 'IPython.terminal.sys',
 'string',
 'IPython.config.sys',
 'IPython.utils.logging',
 'IPython.config.json',
 'encodings.utf_8',
 'IPython.kernel.zmq.serialize',
 'IPython.html.IPython',
 'IPython.kernel.channels',
 'json.encoder',
 'datetime',
 'zmq.devices.threading',
 'zmq.backend.cython.utils',
 'IPython.utils.pickleshare',
 'IPython.utils.errno',
 'IPython.core.debugger',
 'IPython.kernel.inprocess.manager',
 'IPython.core.displayhook',
 'curses.os',
 'IPython.lib.IPython',
 'IPython.core.magics.auto',
 'IPython.lib.select',
 'shlex',
 'IPython.config',
 'IPython.core.ultratb',
 'IPython.kernel.launcher',
 'multiprocessing',
 'IPython.utils.resource',
 'dis',
 'IPython.kernel.IPython',
 'logging.threading',
 'IPython.core.splitinput',
 'IPython.lib.types',
 'IPython.terminal.ipapp',
 'IPython.core.excolors',
 'IPython.utils.tempfile',
 'IPython.extensions.textwrap',
 'IPython.core.inspect',
 'IPython.utils.version',
 'IPython.lib.getpass',
 'abc',
 'IPython.core.displaypub',
 'zmq.utils.sys',
 'bdb',
 'tarfile',
 'IPython.core.mimetypes',
 'IPython.external.path.hashlib',
 'UserDict',
 'zmq.sugar.warnings',
 'zmq.devices.monitoredqueue',
 'IPython.utils.jsonutil',
 'IPython.utils.openpy',
 'IPython.core.alias',
 'inspect',
 'IPython.core.datetime',
 'ctypes.tempfile',
 'simplejson.decoder',
 'IPython.external.path.functools',
 'IPython.lib.collections',
 'IPython.kernel.zmq.cPickle',
 'exceptions',
 'json.scanner',
 'IPython.utils.zmq',
 'codecs',
 'IPython.core.shadowns',
 'IPython.kernel.subprocess',
 'importlib',
 'IPython.core.magics.extension',
 'IPython.utils.shutil',
 'StringIO',
 'weakref',
 'pexpect.termios',
 'IPython.utils.datetime',
 'IPython.kernel.zmq',
 'IPython.core.display',
 'IPython.utils.eventful',
 'IPython.terminal',
 'encodings.binascii',
 'base64',
 '_sre',
 'IPython.core.json',
 'sqlite3.dbapi2',
 'IPython',
 'logging.re',
 'select',
 'IPython.external.path.os',
 '_heapq',
 'IPython.core.display_trap',
 'zmq.sugar.constants',
 'zmq.backend.cython.time',
 'binascii',
 'pexpect.time',
 'zmq.backend.cython._poll',
 'IPython.core.logger',
 'IPython.config.collections',
 'tokenize',
 'IPython.kernel.kernelspec',
 'cPickle',
 'simplejson.sys',
 'IPython.core.magics.errno',
 'IPython.utils.encoding',
 'IPython.core.ast',
 'IPython.core.keyword',
 'IPython.lib.os',
 'IPython.core.magics.itertools',
 'zmq.backend.cython.cPickle',
 'IPython.core.getipython',
 'IPython.core.magics.cProfile',
 'IPython.core.magics.display',
 'IPython.core.page',
 '_ast',
 'IPython.utils.process',
 'zmq.sugar.tracker',
 'zmq.backend.cython.codecs',
 'encodings.aliases',
 'pexpect.resource',
 'fnmatch',
 'sre_parse',
 'tornado.concurrent',
 'pickle',
 'IPython.kernel.blocking.IPython',
 'logging.cStringIO',
 'simplejson.simplejson',
 'numbers',
 'IPython.utils.shlex',
 'IPython.core.magics.signal',
 'IPython.kernel.zmq.heartbeat',
 'IPython.html.nbextensions',
 'IPython.utils.platform',
 'strop',
 'IPython.kernel.manager',
 'IPython.core.history',
 'IPython.external.decorator',
 'IPython.utils.ipstruct',
 'IPython.kernel.channelsabc',
 'zmq.utils.sixcerpt',
 'IPython.extensions.__future__',
 'IPython.config.application',
 'zipfile',
 'htmlentitydefs',
 'zmq.backend.cython.threading',
 'IPython.external.path.fnmatch',
 'pexpect.os',
 'codeop',
 'tornado.platform.interface',
 'IPython.core.magics.osm',
 'os.path',
 'IPython.core.magics.time',
 'IPython.utils.socket',
 'argparse',
 'IPython.kernel.io',
 'simplegeneric',
 'pexpect.struct',
 '_weakrefset',
 'zmq.backend.select',
 'IPython.external.pexpect',
 'IPython.kernel.zmq.ipkernel',
 'tty',
 'functools',
 'sysconfig',
 'IPython.terminal.embed',
 'IPython.kernel.inprocess.client',
 'zmq.devices',
 'sqlite3.collections',
 'IPython.external.path.__future__',
 'uuid',
 'tempfile',
 'IPython.kernel.zmq.thread',
 'IPython.config.configurable',
 'imp',
 'multiprocessing.os',
 'IPython.utils.tempdir',
 'IPython.lib.deepreload',
 'multiprocessing.itertools',
 'IPython.kernel.zmq.IPython',
 'IPython.core.magics.logging',
 'pexpect.codecs',
 'zmq.zmq',
 'IPython.utils.pickleutil',
 'IPython.core.traceback',
 'IPython.html.sys',
 'IPython.core.__main__',
 'IPython.extensions',
 'IPython.utils.hashlib',
 'IPython.config.IPython',
 'zmq.eventloop.__future__',
 'decorator',
 'IPython.core.zipimport',
 'IPython.core.magics.execution',
 'IPython.terminal.interactiveshell',
 'zmq.backend.cython.context',
 'IPython.core.warnings',
 'IPython.utils.imp',
 'logging.handlers',
 'token',
 'IPython.kernel.json',
 'IPython.testing.sys',
 'IPython.core.pylabtools',
 'IPython.utils.warnings',
 'IPython.core.magics.gc',
 'cStringIO',
 'cmd',
 'IPython.kernel.zmq.signal',
 'IPython.core.io',
 'IPython.core.magics.namespace',
 'IPython.kernel.inprocess.Queue',
 'zmq.os',
 'zmq.sugar.frame',
 'zmq.backend.zmq',
 'multiprocessing.process',
 'ctypes.errno',
 'encodings',
 'IPython.kernel.zmq.kernelapp',
 'IPython.core.magics.history',
 'IPython.core.__future__',
 'sqlite3._sqlite3',
 'zmq.backend.cython.struct',
 'IPython.kernel.zmq.atexit',
 'IPython.core.interactiveshell',
 'IPython.utils.base64',
 'zmq.sugar.poll',
 'IPython.core.operator',
 'IPython.core.crashhandler',
 'IPython.utils',
 'IPython.core.magics.ast',
 're',
 'IPython.kernel.zmq.sys',
 'IPython.core.magics.IPython',
 'IPython.utils.capture',
 'sqlite3.time',
 'math',
 'IPython.core.IPython',
 'IPython.kernel.comm.sys',
 'IPython.utils.distutils',
 'IPython.core.importlib',
 'ast',
 'IPython.lib.sys',
 'simplejson.scanner',
 'zmq.utils.constant_names',
 'IPython.external.path.codecs',
 'ctypes.struct',
 'IPython.core.errno',
 '_sysconfigdata_nd',
 '_locale',
 'IPython.core.logging',
 'logging',
 'IPython.kernel.zmq.uuid',
 'thread',
 'traceback',
 'IPython.utils.tokenutil',
 'IPython.core.builtin_trap',
 'zmq.backend.platform',
 'IPython.utils.coloransi',
 'multiprocessing.util',
 'IPython.utils._process_posix',
 'IPython.core.completerlib',
 'pexpect.fcntl',
 'ctypes.re',
 '_collections',
 'IPython.html.os',
 'zmq.sugar.codecs',
 'multiprocessing.sys',
 'array',
 'IPython.kernel.blocking.channels',
 'IPython.utils.locale',
 'IPython.core.magics.pdb',
 'zmq.devices.time',
 'ctypes.sys',
 'IPython.core.magics.config',
 'pexpect',
 'posixpath',
 'ctypes.util',
 'IPython.external.simplegeneric',
 'zmq.zipimport',
 'IPython.utils._sysinfo',
 'zmq.eventloop.ioloop',
 'IPython.lib.imp',
 'types',
 'zmq.backend.cython._device',
 'IPython.utils.textwrap',
 'IPython.core.linecache',
 'json._json',
 'IPython.lib.StringIO',
 '_codecs',
 'zmq.backend.cython.zmq',
 'json.sys',
 'IPython.utils.os',
 'IPython.extensions.inspect',
 'IPython.core.magics.code',
 'copy',
 'hashlib',
 'zmq.error',
 'keyword',
 'IPython.extensions.IPython',
 'posix',
 'IPython.core.hashlib',
 'IPython.config.logging',
 'IPython.utils.codeutil',
 '_curses',
 'IPython.utils.generics',
 'IPython.kernel.zmq.zmq',
 'sre_compile',
 '_hashlib',
 'IPython.utils.ulinecache',
 'IPython.external.path.errno',
 'IPython.core.sqlite3',
 'getpass',
 'logging.collections',
 'IPython.core.threading',
 'zmq.eventloop.zmq',
 '__main__',
 'multiprocessing.atexit',
 'calendar',
 'pexpect.pty',
 'IPython.kernel.zmq.iostream',
 'IPython.core.pprint',
 'encodings.codecs',
 'IPython.utils.__builtin__',
 'IPython.terminal.os',
 'zmq.utils.jsonapi',
 'IPython.kernel.zmq.io',
 'IPython.kernel.blocking.Queue',
 'curses.curses',
 'IPython.kernel.zmq.os',
 'IPython.core.completer',
 'IPython.kernel.zmq.warnings',
 '_ssl',
 'IPython.external.path.glob',
 'IPython.utils.sys',
 'warnings',
 'tornado',
 'IPython.lib.clipboard',
 'glob',
 'IPython.utils.inspect',
 'zmq.backend.cython.sys',
 'pexpect.errno',
 '_sqlite3',
 'IPython.external.path._path',
 'zmq.backend.cython.random',
 'IPython.kernel.zmq.getpass',
 'IPython.kernel.managerabc',
 'multiprocessing._multiprocessing',
 'IPython.html.zipfile',
 'IPython.html',
 'zmq.backend.cython.error',
 'IPython.utils.wildcard',
 'IPython.core.extensions',
 '_io',
 'linecache',
 'IPython.utils.contextlib',
 'IPython.kernel.inprocess.socket',
 'IPython.core.compilerop',
 'simplejson.cStringIO',
 'IPython.config.argparse',
 'hmac',
 'IPython.utils.stat',
 'IPython.external.decorator.decorator',
 '_multiprocessing',
 'IPython.terminal.__future__',
 'random',
 'zmq.sugar.context',
 'subprocess',
 'IPython.extensions.storemagic',
 'logging.os',
 'ctypes._endian',
 'encodings.encodings',
 'IPython.external.path.re',
 'logging.stat',
 'distutils',
 'IPython.core.magic',
 'IPython.utils.dir2',
 '_json',
 'IPython.lib.contextlib',
 'logging.thread',
 'cProfile',
 'IPython.utils.copy_reg',
 'IPython.lib.re',
 'IPython.kernel.zmq.errno',
 'IPython.utils.copy',
 'IPython.kernel.zmq.datetime',
 'repr',
 'ssl',
 'IPython.core.payload',
 'tornado.platform.posix',
 'distutils.re',
 '_lsprof',
 'IPython.utils._tokenize_py2',
 'resource',
 'IPython.kernel.shutil',
 'zmq.sugar',
 'IPython.kernel.os',
 'IPython.html.urlparse',
 'IPython.kernel.inprocess.blocking',
 'IPython.utils.IPython',
 'pydoc',
 'threading',
 'IPython.core.prefilter',
 'IPython.lib.datetime',
 'IPython.core.events',
 'IPython.core.textwrap',
 'locale',
 'atexit',
 'IPython.external',
 'IPython.utils.struct',
 'IPython.core.autocall',
 'IPython.core.sys',
 'pexpect.sys',
 'zmq.backend.cython.message',
 'IPython.core.magics.__future__',
 'timeit',
 'zmq.devices.basedevice',
 'IPython.kernel.comm',
 'tornado.log',
 'urllib',
 'IPython.kernel.zmq.hashlib',
 'zmq.devices.proxydevice',
 'IPython.external.pexpect.pexpect',
 'zmq.sys',
 'fcntl',
 'IPython.utils.path',
 'IPython.core.atexit',
 'zmq.utils',
 'Queue',
 'ctypes',
 'IPython.core.magics.subprocess',
 'IPython.core.magics.re',
 'IPython.utils._process_common',
 'IPython.lib.distutils',
 'IPython.kernel.zmq.datapub',
 'json.re',
 'IPython.utils.collections',
 'itertools',
 'opcode',
 'pstats',
 'pdb',
 'IPython.kernel.zmq.parentpoller',
 'IPython.extensions.os',
 'IPython.core.magics.atexit',
 'IPython.kernel.comm.IPython',
 'IPython.kernel.zmq.logging',
 'IPython.testing',
 'sqlite3.datetime',
 'zmq.sugar.socket',
 'IPython.html.shutil',
 'logging.errno',
 'platform',
 'curses._curses',
 'encodings.unicode_escape',
 'IPython.external.path',
 'IPython.core.hooks',
 'IPython.display',
 'pkgutil',
 'IPython.core.tokenize',
 'IPython.external.path.pwd',
 'IPython.lib.__future__',
 'zmq.devices.zmq',
 'zmq.backend.cython',
 'logging.struct',
 'sre_constants',
 'zmq.backend.os',
 'json',
 'IPython.lib.backgroundjobs',
 'IPython.config.__future__',
 'IPython.kernel.zmq.time',
 'IPython.external.path.shutil',
 'zmq.utils.itertools',
 'zmq.eventloop',
 'IPython.kernel.zmq.platform',
 'termios',
 'IPython.IPython',
 'logging.atexit',
 'logging.cPickle',
 'IPython.kernel',
 'logging.socket',
 'multiprocessing.multiprocessing',
 'IPython.core.bdb',
 'simplejson._speedups',
 'storemagic',
 'zlib',
 'simplejson.re',
 'IPython.external.path.warnings',
 'json.decoder',
 'copy_reg',
 'tornado.platform.auto',
 'IPython.utils.linecache',
 'site',
 'IPython.external.path.operator',
 'IPython.core.shutil',
 'zmq.devices.monitoredqueuedevice',
 'io',
 'shutil',
 'IPython.utils.random',
 'zmq.sugar.zmq',
 'zmq.backend.sys',
 'IPython.lib.warnings',
 'IPython.utils.decorators',
 'encodings.hex_codec',
 'IPython.testing.skipdoctest',
 'IPython.core.magics.timeit',
 'IPython.core.magics.script',
 'sqlite3',
 'IPython.utils.localinterfaces',
 'IPython.kernel.clientabc',
 'IPython.core.macro',
 'IPython.kernel.sys',
 'IPython.kernel.zmq.__future__',
 'IPython.core.magics.pprint',
 'IPython.utils.data',
 'json.json',
 'IPython.core.types',
 'sys',
 'IPython.utils.log',
 'IPython.kernel.comm.comm',
 'IPython.terminal.IPython',
 'multiprocessing.subprocess',
 'importlib.sys',
 'multiprocessing.weakref',
 'IPython.core.magics.StringIO',
 'IPython.core.usage',
 'IPython.utils.importstring',
 'IPython.kernel.adapter',
 '_weakref',
 'IPython.core.inputtransformer',
 'urlparse',
 'IPython.lib.threading',
 'IPython.kernel.zmq.kernelbase',
 'IPython.core.application',
 'IPython.core',
 'IPython.core.magics.io',
 'IPython.utils.terminal',
 'IPython.core.StringIO',
 'logging.logging',
 'heapq',
 'IPython.utils.math',
 'IPython.core.time',
 'zmq.glob',
 'IPython.kernel.comm.manager',
 'IPython.kernel.zmq.displayhook',
 'zmq.backend.cython.socket',
 'IPython.core.oinspect',
 'zmq.sugar.attrsettr',
 'tornado.escape',
 'IPython.core.os',
 'zmq.backend.cython.constants',
 'struct',
 'IPython.utils.strdispatch',
 'IPython.core.inputsplitter',
 'IPython.utils.tokenize2',
 'IPython.utils.traitlets',
 '_abcoll',
 'collections',
 'IPython.html.tarfile',
 'IPython.lib.inputhook',
 'zmq.sugar.atexit',
 'IPython.core.pydoc',
 'distutils.types',
 'IPython.extensions.sys',
 'IPython.utils.warn',
 'zipimport',
 'IPython.core.struct',
 'textwrap',
 'IPython.lib.subprocess',
 'IPython.core.codeop',
 'IPython.kernel.inprocess',
 'tornado.util',
 'pexpect.traceback',
 'IPython.core.magics.bdb',
 'zmq.backend.cython._version',
 'pexpect.types',
 'IPython.lib.random',
 'IPython.utils.frame',
 'signal',
 'IPython.core.payloadpage',
 '_ctypes',
 'IPython.terminal.warnings',
 'IPython.utils.zmqrelated',
 'IPython.kernel.multikernelmanager',
 'IPython.core.magics',
 'IPython.external.simplegeneric.simplegeneric',
 'decimal',
 'IPython.kernel.zmq.session',
 'zmq.eventloop.zmqstream',
 'IPython.core.getopt',
 'IPython.kernel.inprocess.channels',
 'IPython.config.os',
 'IPython.lib.display',
 'stat',
 'zmq.backend.cython.copy',
 'IPython.utils.token',
 'IPython.utils.module_paths',
 'logging.traceback',
 'IPython.core.magic_arguments',
 'tornado.stack_context',
 'IPython.utils.re',
 'IPython.utils.sysinfo',
 'IPython.core.argparse',
 'IPython.utils.io',
 'IPython.core.subprocess',
 'IPython.html.urllib',
 'ctypes._ctypes',
 'encodings.ascii',
 'IPython.utils.subprocess',
 'IPython.utils.syspathcontext',
 'IPython.core.itertools',
 'IPython.lib',
 'zmq.sugar.random',
 'IPython.utils.PyColorize',
 'logging.sys',
 'pexpect.re',
 'IPython.lib.ctypes',
 '_functools',
 'IPython.kernel.zmq.random',
 'socket',
 'simplejson.compat',
 'IPython.kernel.zmq.socket',
 'zmq.sugar.version',
 'pexpect.signal',
 'IPython.core.magics.basic',
 'IPython.utils.contexts',
 'IPython.core.imp',
 'zmq.eventloop.sys',
 'IPython.core.socket',
 'IPython.core.pdb',
 'os',
 'marshal',
 'distutils.version',
 '__future__',
 'IPython.kernel.abc',
 'distutils.string',
 'curses',
 'IPython.core.magics.pstats',
 '__builtin__',
 'IPython.kernel.blocking',
 'operator',
 'json.struct',
 'IPython.core.shellapp',
 'IPython.external.path.sys',
 'zmq.eventloop.tornado',
 'IPython.core.re',
 'errno',
 '_socket',
 'IPython.utils.rlineimpl',
 'IPython.core.magics.json',
 'IPython.core.glob',
 'IPython.core.abc',
 'IPython.kernel.zmq.ctypes',
 'simplejson.encoder',
 '_warnings',
 'IPython.core.magics.sys',
 'IPython.core.latex_symbols',
 'zmq.eventloop.cPickle',
 'IPython.utils.text',
 'encodings.__builtin__',
 'IPython.utils.__future__',
 'simplejson',
 'tornado.platform',
 'IPython.core.profiledir',
 'IPython.utils.cPickle',
 'pwd',
 'curses.wrapper',
 'zmq.backend',
 'IPython.utils.types',
 'IPython.core.magics.inspect',
 '_sysconfigdata',
 '_struct',
 'IPython.core.magics.pylab',
 'IPython.kernel.zmq.traceback',
 'IPython.core.functools',
 'IPython.lib.signal',
 'logging.time',
 'IPython.kernel.zmq.threading',
 'IPython.kernel.zmq.zmqshell',
 'logging.warnings',
 'IPython.terminal.bdb',
 'multiprocessing.signal',
 'logging.codecs',
 '_random',
 'zmq.utils.zmq',
 'contextlib',
 'IPython.utils.time',
 'IPython.core.magics.os',
 'IPython.lib.hashlib',
 'IPython.utils.glob',
 'zmq.sugar.cPickle',
 'zmq.utils.strtypes',
 'IPython.core.string',
 'grp',
 'IPython.core.release',
 'IPython.lib.pretty',
 '_strptime',
 'gettext',
 'IPython.external.path.tempfile',
 'IPython.utils.string',
 'IPython.utils.timing',
 'pexpect.tty',
 'getopt',
 'zmq.sugar.time',
 'zmq.eventloop.Queue',
 'genericpath',
 'mimetypes',
 'IPython.kernel.inprocess.abc',
 'IPython.core.prompts',
 'IPython.core.formatters',
 'IPython.lib.security',
 'tornado.speedups',
 'time',
 'multiprocessing.threading',
 'zmq.sugar.threading',
 'IPython.config.loader',
 'zmq.devices.multiprocessing',
 'ctypes.ctypes',
 'IPython.utils.functools',
 'readline',
 'zmq.utils.interop',
 'IPython.kernel.zmq.hmac',
 'sitecustomize',
 'IPython.kernel.zmq.pprint',
 'IPython.html.__future__',
 'IPython.kernel.client',
 'IPython.core.magics.deprecated',
 'IPython.utils.signatures',
 'IPython.core.tempfile',
 'IPython.config.copy',
 'IPython.kernel.inprocess.IPython',
 'IPython.utils.py3compat',
 'tornado.ioloop']

In [ ]: