Re: Installing PyGame?

2013-06-08 Thread cclauss
At the Terminal prompt type: python -c "help('modules')"

If Pygame is not somewhere in the output then Pygame is not yet installed.

If it is not installed then type: pip install --upgrade pygame 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing PyGame?

2013-06-08 Thread cclauss
Type: python -V
(That was a capitol V) What version of python is running?

Type: python3 -V
(That was a capitol V) What version of python is running?

Type: python -c 'import pygame'
What is the exact error message?

Type: python
Your prompt should change to something like: >>>
Type: import pygame
What is the exact error message?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Listing modules from all installed packages

2013-06-09 Thread cclauss
Adding : python -c 'help("modules") to the other two suggestions:

#!/usr/bin/env python

import commands, pkgutil, re, sys

print('sys.modules.items()...')
print('\n'.join(sorted([re.findall("from '(.*)'",str(v))[0] for k,v in 
sys.modules.items() if str(v).find('from')>-1])))

print('\npkgutil.iter_modules()...')
toplevel_packages = ['%s\\%s'%(ml.path,name)for ml,name,ispkg in 
sorted(pkgutil.iter_modules()) if ispkg]
print '\n'.join(toplevel_packages)

theCommand = "python -c 'help(\"modules\")'"
print('\n{} # this may take a few seconds...'.format(theCommand))
print(commands.getstatusoutput(theCommand)[1]) # help() only works in the 
python interpreter...
-- 
http://mail.python.org/mailman/listinfo/python-list